- Home /
Can't remove/replace/clear list items
Hi there. So I've got a game in development, and I've been working on keyboard navigating the GUI. Right now, it uses a list, which holds the names of the buttons in the current menu, then iterates through that list and sets the focused item accordingly. This is working great, until a certain point in my code.
void ClassicLunar_Button()
{
globalVars.selectedShip = "ClassicLunar";
ChangeMenu ("Arcade_Level_Select");
selectedIndex = 1;
globalVars.currentMenuButtons.Clear ();
globalVars.currentMenuButtons.Add ("LevelOneButton");
globalVars.currentMenuButtons.Add ("LevelTwoButton");
}
I know that's not too much code, but it works fine just the same anywhere else, except up to here. Debug.Log reveals that the selected gui element is one from the previous menu, so it isn't clearing properly for some reason. I'd post more, but it's a rather large amount of code that would be kind of hard to understand. I've tried removing specific elements from the list, and I've tried setting individual elements to new values manually. Does anyone have any ideas?
Your answer
Follow this Question
Related Questions
Clear whole list 0 Answers
A node in a childnode? 1 Answer
How to remove project from the Project Wizard 6 Answers
List That Won't Remove The Last Two Elements 3 Answers
Removing object from a list also removes it from a different list? help! 2 Answers