-2
im Tring to makeI’m trying to make a button that closes the hack_panel but it didn’t work
public class Level1_Controller : MonoBehaviour {
//Variables
public Button Hack;
public Button Develop;
public Button Research;
public Button SQ;
public GameObject Hack_Panel;
public bool isOpened;
// Use this for initialization
void Start () {
isOpened = false;
Hack.onClick.AddListener(Goto_hack);
Develop.onClick.AddListener(Goto_develop);
Research.onClick.AddListener(Goto_research);
SQ.onClick.AddListener(Goto_sq);
}
public void Goto_hack() {
if(isOpened == false) {
Hack_Panel.gameObject.SetActive(true);
} else {
Hack_Panel.gameObject.SetActive(false);
}
}
public void Goto_develop() {
}
public void Goto_research() {
}
public void Goto_sq() {
}
// Update is called once per frame
void Update () {
Goto_hack();
Goto_develop();
Goto_research();
Goto_sq();
}
}
thank leandro
– HK_731