Created
April 1, 2017 15:10
-
-
Save anonymous/47a43d3cea3c7ff84ebe9f907adbbcf0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/********* | |
* 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