Skip to content

Instantly share code, notes, and snippets.

/file.cs

Created Apr 1, 2017
Embed
What would you like to do?
/*********
* 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
You can’t perform that action at this time.