Ejemplo n.º 1
0
 void Update()
 {
     if (ActiveCanvas == MainCanvas)
     {
     }
     if (ActiveCanvas == GameCanvas)
     {
     }
     if (ActiveCanvas == SearchingCanvas)
     {
     }
     if (ActiveCanvas == SpellsCanvas)
     {
         if (TREE != null && TREE.activeInHierarchy == true)
         {
             if (Input.GetKeyDown(KeyCode.Escape))
             {
                 if (ChoosingOff != null)
                 {
                     ChoosingOff.transform.localScale = new Vector3(1, 1, 1);
                 }
                 if (ChoosingDeff != null)
                 {
                     ChoosingDeff.transform.localScale = new Vector3(1, 1, 1);
                 }
                 TREE.SetActive(false);
             }
         }
     }
 }
Ejemplo n.º 2
0
 public void ActivateDeffTree()
 {
     if (TREE != null)
     {
         TREE.SetActive(false);
     }
     DeffTreeGameObject.SetActive(true);
     TREE = DeffTreeGameObject;
 }
Ejemplo n.º 3
0
 public void Deffensive(Button spell, int index)
 {
     if (ChoosingDeff.name == "Deff1")
     {
         if (DeffType != ChosenDeffType || DeffElement != ChosenDeffElement)
         {
             ResetDeff();
         }
         ChosenDeffType    = DeffType;
         ChosenDeffElement = DeffElement;
         DeffButton1.GetComponentInChildren <Image>().color  = new Color(1, 1, 1, 1);
         DeffButton1.GetComponentInChildren <Image>().sprite = spell.GetComponent <Image>().sprite;
         Deff1 = spell.name;
         ChoosingDeff.transform.localScale = new Vector3(1, 1, 1);
         DeffButton1.GetComponentInChildren <Image>().transform.localScale = new Vector3(spellList.Scale[index].x, spellList.Scale[index].y, 1);
         TREE.SetActive(false);
     }
 }
Ejemplo n.º 4
0
 //Funkcje zapisu wybranego spella w wybranym slocie
 public void Offensive(Button spell, int index)
 {
     if (ChoosingOff.name == "Off1")
     {
         if (OffType != ChosenOffType || OffElement != ChosenOffElement)
         {
             ResetOff();
         }
         ChosenOffType    = OffType;
         ChosenOffElement = OffElement;
         OffButton1.GetComponentInChildren <Image>().color  = new Color(1, 1, 1, 1);
         OffButton1.GetComponentInChildren <Image>().sprite = spell.GetComponent <Image>().sprite;
         Off1 = spell.name;
         if (Off1 == Off2)
         {
             Off2 = "";
             OffButton2.GetComponentInChildren <Image>().color = new Color(1, 1, 1, 0);
         }
         if (Off1 == Off3)
         {
             Off3 = "";
             OffButton3.GetComponentInChildren <Image>().color = new Color(1, 1, 1, 0);
         }
         ChoosingOff.transform.localScale = new Vector3(1, 1, 1);
         OffButton1.GetComponentInChildren <Image>().transform.localScale = new Vector3(spellList.Scale[index].x, spellList.Scale[index].y, 1);
         TREE.SetActive(false);
     }
     else if (ChoosingOff.name == "Off2")
     {
         if (OffType != ChosenOffType || OffElement != ChosenOffElement)
         {
             ResetOff();
         }
         ChosenOffType    = OffType;
         ChosenOffElement = OffElement;
         OffButton2.GetComponentInChildren <Image>().color  = new Color(1, 1, 1, 1);
         OffButton2.GetComponentInChildren <Image>().sprite = spell.GetComponent <Image>().sprite;
         Off2 = spell.name;
         if (Off2 == Off1)
         {
             Off1 = "";
             OffButton1.GetComponentInChildren <Image>().color = new Color(1, 1, 1, 0);
         }
         if (Off2 == Off3)
         {
             Off3 = "";
             OffButton3.GetComponentInChildren <Image>().color = new Color(1, 1, 1, 0);
         }
         ChoosingOff.transform.localScale = new Vector3(1, 1, 1);
         OffButton2.GetComponentInChildren <Image>().transform.localScale = new Vector3(spellList.Scale[index].x, spellList.Scale[index].y, 1);
         TREE.SetActive(false);
     }
     else if (ChoosingOff.name == "Off3")
     {
         if (OffType != ChosenOffType || OffElement != ChosenOffElement)
         {
             ResetOff();
         }
         ChosenOffType    = OffType;
         ChosenOffElement = OffElement;
         OffButton3.GetComponentInChildren <Image>().color  = new Color(1, 1, 1, 1);
         OffButton3.GetComponentInChildren <Image>().sprite = spell.GetComponent <Image>().sprite;
         Off3 = spell.name;
         if (Off3 == Off1)
         {
             Off1 = "";
             OffButton1.GetComponentInChildren <Image>().color = new Color(1, 1, 1, 0);
         }
         if (Off3 == Off2)
         {
             Off2 = "";
             OffButton2.GetComponentInChildren <Image>().color = new Color(1, 1, 1, 0);
         }
         ChoosingOff.transform.localScale = new Vector3(1, 1, 1);
         OffButton3.GetComponentInChildren <Image>().transform.localScale = new Vector3(spellList.Scale[index].x, spellList.Scale[index].y, 1);
         TREE.SetActive(false);
     }
 }