Question by
m.noumanahmed · Jan 20, 2016 at 05:57 AM ·
unity 4.6
UI Prev button
Hi I wrote the code for swiping images on next and previous UI button press.
this is my code
public GameObject[] gunSwipe; public int arrayIndexer;
public void BtnController(string name){
if(name == "Next"){
arrayIndexer++;
for(int i = 0; i< gunSwipe.Length-1; i++){
if(i== arrayIndexer){
gunSwipe[arrayIndexer].SetActive(true);
}else{
gunSwipe[arrayIndexer].SetActive(false);
}
}
}
II this is working for next button, but when i reverse it for previous button it does not work, arrayIndexer--; is working but it does not swipe the image
Comment
Your answer
Follow this Question
Related Questions
Error when trying to build with Admob 0 Answers
GUI Box doesn't work 0 Answers
can i still publish a game from unity 4.x to IOS / Android / PC ? 1 Answer