I have an array of gameobjects, and want to activate one with index 0, and after a tap of a button, the gameobject with index 0 gets hidden, and the one with index 1 gets active and so on.
public GameObject[] QuestionList;
private int QuestionsArrayIndex;
public void Start()
{
QuestionsArrayIndex = 0;
QuestionList[QuestionsArrayIndex].SetActive(true);
Shuffle();
}
public void ScreenTap()
{
if (QuestionList[QuestionsArrayIndex].activeInHierarchy)
{
QuestionsArrayIndex++;
QuestionList[QuestionsArrayIndex].SetActive(false);
}
}