Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- using UnityEngine.UI;
- public class Selection : MonoBehaviour {
- public GameObject panel1;
- public GameObject panel2;
- public GameObject panel3;
- Text tex;
- public bool bool1 = false;
- public bool bool2 = false;
- public bool bool3= false;
- public bool isArcherAtack = false;
- public bool isMageAtack = false;
- public bool isTrollAtack = false;
- public GameObject select1;
- public GameObject select2;
- public GameObject select3;
- public GameObject troll;
- public GameObject archer;
- public GameObject mage;
- public GameObject textt;
- void Start()
- {
- tex = textt.GetComponent<Text>();
- }
- public void panel1_true() //troll
- {
- select2.SetActive(false);
- select3.SetActive(false);
- panel1.SetActive(!bool1);
- select1.SetActive(bool1);
- bool1=!bool1;
- }
- public void panel2_true() //archer
- {
- select1.SetActive(false);
- select3.SetActive(false);
- panel2.SetActive(!bool2);
- select2.SetActive(bool2);
- bool2=!bool2;
- }
- public void panel3_true() //mage
- {
- select1.SetActive(false);
- select2.SetActive(false);
- panel3.SetActive(!bool3);
- select3.SetActive(bool3);
- bool3=!bool3;
- }
- public void Attack1_button() //troll
- {
- troll.GetComponent<Hero>().TrollAttack();
- isTrollAtack = true;
- panel1.SetActive(false);
- select1.SetActive(!isTrollAtack);
- select2.SetActive(!isArcherAtack);
- select3.SetActive(!isMageAtack);
- }
- public void Attack2_button() //archer
- {
- archer.GetComponent<Hero>().ArcherAttack();
- isArcherAtack = true;
- panel2.SetActive(false);
- select1.SetActive(!isTrollAtack);
- select2.SetActive(!isArcherAtack);
- select3.SetActive(!isMageAtack);
- }
- public void Attck3_butoon() //mage
- {
- mage.GetComponent<Hero>().MageAttack();
- isMageAtack = true;
- panel3.SetActive(false);
- select1.SetActive(!isTrollAtack);
- select2.SetActive(!isArcherAtack);
- select3.SetActive(!isMageAtack);
- }
- public void End_Turn_Button()
- {
- if ((isMageAtack == true)&&(isArcherAtack == true)&&(isTrollAtack == true))
- {
- tex.text = "Ход противника";
- Invoke("TextChanger",6);
- }
- }
- void TextChanger()
- {
- tex.text = "End turn";
- bool1 = false;
- bool2 = false;
- bool3= false;
- isArcherAtack = false;
- isMageAtack = false;
- isTrollAtack = false;
- select1.SetActive(!isTrollAtack);
- select2.SetActive(!isArcherAtack);
- select3.SetActive(!isMageAtack);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement