downBtn.onClick.AddListener(() =>
{
for (int i = 0; i < Container.Length; i++)
{
int nextIndex = (i + 1) % Container.Length;
if (Container[i].gameObject.activeSelf)
{
Container[i].gameObject.SetActive(false);
Container[nextIndex].gameObject.SetActive(true);
return;
}
}
});
upBtn.onClick.AddListener(() =>
{
for (int i = 0; i < Container.Length; i++)
{
int nextIndex = (i - 1 + Container.Length) % Container.Length;
if (Container[i].gameObject.activeSelf && nextIndex != 2)
{
Container[i].gameObject.SetActive(false);
Container[nextIndex].gameObject.SetActive(true);
return;
}
}
});