Hello,
I want to put an index for each item in the list and every button takes an index of the item and when I press any button it opens up the corresponding panel for the button.
public GameObject ClanDescriptionContainer;
GameObject Descripition = Instantiate(ClanDescriptionPrefab, ClanDescriptionContainer.transform) as GameObject;
cList = new GameObject[ClanDescriptionContainer.transform.childCount];
for (int i = 0; i < ClanDescriptionContainer.transform.childCount; i++)
cList *= ClanDescriptionContainer.transform.GetChild(i).gameObject;*
foreach (GameObject go in cList)
go.SetActive(false);
}
}
public void Join()
{
cList[index].SetActive(false);
index++;
if (index == cList.Length)
index = 0;
cList[index].SetActive(true);
}
public void SelectButton(int buttonIndex)
{
for (int i = 0; i < cList.Length; ++i)
cList*.SetActive(i == buttonIndex);*
}