I am working in unity and I have a group of buttons that I activate/deactivate at various times in the game. However, I have noticed that when I call
button.SetActive(true) the button doesn't appear in the scene right away. In one particular circumstance, I need the button the appear before the next line of code is run. Is there a way to force the button/scene to update immediately?
Edit: To give some context, I am working on a card game similar to Magic the Gathering where there are different types of mana and there are some cards with a neutral cost. When a player plays one of these cards I activate 5 buttons (one for each mana type), and I want the player to click a button to spend one mana of that color, and to repeat that process until the neutral cost is met.
When I try to use a while loop or a coroutine to essentially pause execution until a user clicks a button (or multiple, depending on the card's cost), I cause an infinite loop because even though I set the buttons to active before the loop/coroutine, they don't actually activate by the time the loop starts.