- Home /
Question by
shirtface · Aug 15, 2015 at 05:10 PM ·
c#uicompilationselectable
Cannot get the next selectable item during compile time
Hello
I am attempting to insert buttons into a list with this script that runs on Start() Note that the buttons navigation is set to automatic.
Selectable potentialButton = firstButton;
while (true)
{
if (potentialButton == null)
{
Debug.Log("button is null");
break;
}
if (IsValidButton(potentialButton))
{
TopRow.Add((Button)potentialButton);
potentialButton = potentialButton.FindSelectableOnRight() as Button;
}
}
However it doesn't seem to be adding the buttons properly. Matter of fact, the number of items in the TopRow list seems to be random. However when I run that same command during runtime, I am getting the correct number of elements inserted into the list. This is strange behaviour, how do I go about correcting this?
Comment
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Request feedback for C# script (instantiating UI elements depending on Player Input) 0 Answers
UI Decreasing Timer Bar Not Executing Print? 1 Answer
UI text showing money 2 Answers