- Home /
Question by
sona.viswam · Feb 05, 2013 at 10:13 AM ·
c#buttonmonodevelopnguiunit
Next and previous button in NGUI
I have two buttons on both sides of simple texture.
Only three types of image i have. that i kept in a array.
while clicking on next button, image name print.
but previous function not working properly .
i declared in UIButtonMessage.cs
public string[] imageArray = {"c1_ipad", "c2_ipad", "c3_ipad"};
public int arrayKey;
and function
void Next()
{
if(arrayKey!=2)
{
arrayKey = arrayKey + 1;
}
print(imageArray[arrayKey]);
}
void Previous ()
{ print(arrayKey);
if(arrayKey!=0)
{
arrayKey = arrayKey - 1;
}
print(arrayKey);
print(imageArray[arrayKey]);
}
but arraykey changed in one function , not getting in another function.
Please help me solve to this issue.
i am very new to NGUI. how can i show image in simple texture.
Thanks in advance
Comment
Your answer
Follow this Question
Related Questions
panel hide and show in NGUI 1 Answer
Distribute terrain in zones 3 Answers
Multiple Cars not working 1 Answer
Custom Behaivior on highlighting button 0 Answers
Button doesn't work when returning to scene (android) 1 Answer