Why is my listdisplaying that an item was removed?
So I have a pretty weirdly done quest UI setup, my goal is for the quest to be given to the player and for it to be added to the quest list and then the UI text will update to display the names of the quests... However the quest name doesn't get removed from the list when the quest is complete even though I ran debug.log to check it carried out the code and it did. So this leaves me to assume its the UI not updating right. Can someone please tell me a way round this researched this for nearly 18 hours dev time. I can't solve it so maybe someone can point out the obvious... Like singletons and combinatorics, sure thats fine but simple UI... breaks Send help!
Nothing obvious stood out to me. But I would probably debug the list itself to make sure the quest is being removed. Run this immediately after you remove the quest:
for (int i=0; i<QuestPanelHandler.ActiveQuests.Length; i++)
{
Debug.log (QuestPanelHandler.ActiveQuests[i]+" ("+i+")");
}
I suspect the problem is in the removal of the string as opposed to the UI text. This should confirm if the quest is actually being removed.
I'd also suggest updating the UI text in a method that you call as you add or remove a quest (like RefreshUI() ). Where it is, it's being updated every frame, which is an unnecessary drain on resources. If you were getting 60fps, you are updating the text 60 times every second, ins$$anonymous$$d of once every 5 or 10 $$anonymous$$utes.
Your answer
Follow this Question
Related Questions
how to connect my Health to my UI 1 Answer
How do I add 10 UI text elements to an array or a list...? 1 Answer
Number string to .text returning 0 0 Answers
Why is this List only showing one int? 0 Answers