Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

Created April 1, 2017 15:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/47a43d3cea3c7ff84ebe9f907adbbcf0 to your computer and use it in GitHub Desktop.
Save anonymous/47a43d3cea3c7ff84ebe9f907adbbcf0 to your computer and use it in GitHub Desktop.
/*********
* This Gist was created at CSharpPad.com
* To run this file, open http://csharppad.com/gist/c41b56aa4acb366b74de4d0618df8dae
**********/
public GameObject[] Pages;
private int index;
public void Button_NextPage()
{
if (index == Pages.Length - 1) return;
index++;
for (int i = 0; i < Pages.Length; i++)
if (index == i)
Pages[i].SetActive(true);
else
Pages[i].SetActive(false);
}
public void Button_PrevPage()
{
if (index == 0) return;
index--;
for (int i = 0; i < Pages.Length; i++)
if (index == i)
Pages[i].SetActive(true);
else
Pages[i].SetActive(false);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment