Hi
Can anyone advise how to make button at pause. I want to be when you play have sprite and at pause other, not make it go away when you press the right. Like music on / off… I can not find anything with Unit 5 UI system.
Thanks a lot
Hi
Can anyone advise how to make button at pause. I want to be when you play have sprite and at pause other, not make it go away when you press the right. Like music on / off… I can not find anything with Unit 5 UI system.
Thanks a lot
You can use the Toggle component. Put one image for off, and on top of it, another image for on. Attack the toggle’s “Graphic” parameter to the on sprite, it will automatically turn it on or off when the toggle is on or off.
Then toggle.onValueChanged to a method that will pause/unpause the game.
If you have other ways of pausing the game (keyboard, autopause), make sure that you also set the toggle.isOn to true, and to false when unpausing.