I can open up this panel and close it just fine with a separate button, but the four buttons on this panel are completely non-responsive. I have an EventSystem and I believe all the buttons are correctly linked to where they should be.
public GameObject chao;
public GameObject chaoPanel;
public GameObject[] chaoList;
void Start()
{
if (!PlayerPrefs.HasKey("looks"))
{
PlayerPrefs.SetInt("looks", 0);
createChao(PlayerPrefs.GetInt("looks"));
}
}
public void buttonBehavior (int i)
{
switch(i)
{
case (0):
default:
chaoPanel.SetActive(!chaoPanel.activeInHierarchy);
break;
case (1):
break;
case (2):
break;
case (3):
if (MusicPlayer.GetComponent<AudioSource>().isPlaying)
{
MusicPlayer.GetComponent<AudioSource>().Pause();
}
else
{
MusicPlayer.GetComponent<AudioSource>().UnPause();
}
break;
case (4):
chao.GetComponent<Chao>().saveChao();
Application.Quit();
break;
}
}
public void createChao (int i)
{
if (chao)
{
Destroy(chao);
chao = Instantiate(chaoList[i], new Vector3(0,0,-2), Quaternion.identity) as GameObject;
}
if (chaoPanel.activeInHierarchy)
chaoPanel.SetActive(false);
PlayerPrefs.SetInt("looks", i);
}