Пример #1
0
 public void UpdateDeffTree()
 {
     if (DeffType == "Range")
     {
         if (DeffElement == "Fire")
         {
             FireDeffRange();
         }
         else if (DeffElement == "Earth")
         {
             EarthDeffRange();
         }
         else if (DeffElement == "Water")
         {
             WaterDeffRange();
         }
         else if (DeffElement == "Shadow")
         {
             ShadowDeffRange();
         }
     }
     if (DeffType == "Melee")
     {
         if (ADT != null)
         {
             ADT.SetActive(false);
         }
     }
 }
Пример #2
0
 void ShadowDeffRange()
 {
     if (ADT != null)
     {
         ADT.SetActive(false);
     }
     SDR.SetActive(true);
     ADT = SDR;
     PlayerPrefs.SetInt("ADT", 3);
     PlayerPrefs.Save();
 }
Пример #3
0
 void WaterDeffRange()
 {
     if (ADT != null)
     {
         ADT.SetActive(false);
     }
     WDR.SetActive(true);
     ADT = WDR;
     PlayerPrefs.SetInt("ADT", 2);
     PlayerPrefs.Save();
 }
Пример #4
0
 void EarthDeffRange()
 {
     if (ADT != null)
     {
         ADT.SetActive(false);
     }
     EDR.SetActive(true);
     ADT = EDR;
     PlayerPrefs.SetInt("ADT", 1);
     PlayerPrefs.Save();
 }
Пример #5
0
 void FireDeffRange()
 {
     if (ADT != null)
     {
         ADT.SetActive(false);
     }
     FDR.SetActive(true);
     ADT = FDR;
     PlayerPrefs.SetInt("ADT", 0);
     PlayerPrefs.Save();
 }
Пример #6
0
 //Menu wyboru spelli
 public void ChooseSpells()
 {
     ActiveCanvas.SetActive(false);
     SpellsCanvas.SetActive(true);
     ActiveCanvas = SpellsCanvas;
     if (AOT != null)
     {
         AOT.SetActive(true);
     }
     if (ADT != null)
     {
         ADT.SetActive(true);
     }
     if (Off1 != "")
     {
         for (int i = 0; i < spells.Names.Count; i++)
         {
             if (Off1 == spells.Names[i])
             {
                 OffButton1.GetComponentInChildren <Image>().color  = new Color(1, 1, 1, 1);
                 OffButton1.GetComponentInChildren <Image>().sprite = spells.Images[i];
                 OffButton1.GetComponentInChildren <Image>().transform.localScale = new Vector3(spellList.Scale[i].x, spellList.Scale[i].y, 1);
             }
         }
     }
     else
     {
         OffButton1.GetComponentInChildren <Image>().color = new Color(1, 1, 1, 0);
     }
     if (Off2 != "")
     {
         for (int i = 0; i < spells.Names.Count; i++)
         {
             if (Off2 == spells.Names[i])
             {
                 OffButton2.GetComponentInChildren <Image>().color  = new Color(1, 1, 1, 1);
                 OffButton2.GetComponentInChildren <Image>().sprite = spells.Images[i];
                 OffButton2.GetComponentInChildren <Image>().transform.localScale = new Vector3(spellList.Scale[i].x, spellList.Scale[i].y, 1);
             }
         }
     }
     else
     {
         OffButton2.GetComponentInChildren <Image>().color = new Color(1, 1, 1, 0);
     }
     if (Off3 != "")
     {
         for (int i = 0; i < spells.Names.Count; i++)
         {
             if (Off3 == spells.Names[i])
             {
                 OffButton3.GetComponentInChildren <Image>().color  = new Color(1, 1, 1, 1);
                 OffButton3.GetComponentInChildren <Image>().sprite = spells.Images[i];
                 OffButton3.GetComponentInChildren <Image>().transform.localScale = new Vector3(spellList.Scale[i].x, spellList.Scale[i].y, 1);
             }
         }
     }
     else
     {
         OffButton3.GetComponentInChildren <Image>().color = new Color(1, 1, 1, 0);
     }
     if (Deff1 != "")
     {
         for (int i = 0; i < spells.Names.Count; i++)
         {
             if (Deff1 == spells.Names[i])
             {
                 DeffButton1.GetComponentInChildren <Image>().color  = new Color(1, 1, 1, 1);
                 DeffButton1.GetComponentInChildren <Image>().sprite = spells.Images[i];
                 DeffButton1.GetComponentInChildren <Image>().transform.localScale = new Vector3(spellList.Scale[i].x, spellList.Scale[i].y, 1);
             }
         }
     }
     else
     {
         DeffButton1.GetComponentInChildren <Image>().color = new Color(1, 1, 1, 0);
     }
 }