Man in just 1 minute of video you took me for hours a doubt, which lasted hours thank you very much. sorry my english, i speak portuguese.
@simas387
3 жыл бұрын
no one asked what language you speak, keep it to yourself next time
@matheusoliveira2575
3 жыл бұрын
@@simas387 Ok, as soon as someone aske me, I came here and ask who asked you
@anon-n1d
2 жыл бұрын
@@simas387 bro chill who tf hurt u
@rafagruba5879
3 жыл бұрын
I don't really understand why this video has some many downvotes. To me it was very helpful :)
@Broockle
Жыл бұрын
i'm confused why he needs to make a custom script. Isn't the whole point of the Toggle to do exactly this, to Toggle? Might as well use a Button instead. I'ma keep looking.
@Dark-gb5xx
3 жыл бұрын
How to save Toggle value ? For example if i turned off sound in a game then restarted the game then it should remain off and not not get back on
@jamesohia9250
3 жыл бұрын
You can make use of player prefs.
@SMT-ks8yp
2 жыл бұрын
@@jamesohia9250 yes, you can save and load with it all you want, but how to pass it to the toggle? Say, it always starts with "true" upon enabling the UI, while value behind it might be false. What then? I can't find anything about it, even in the Unity manual. Is isOn read only, for example?
@RUDERUDYGAMER
10 ай бұрын
Thank you very helpful indeed.
@creatingwithlove
3 жыл бұрын
What I want to do is be able to stop the user from interacting with the toggle if they don't have an adequate amount of money earned and to purchase an item after putting a checkmark in the box if they do.
@ryanbeattie9170
3 жыл бұрын
Hello, There are probably many ways to handle this, but this is just a basic idea to help you out on this topic if you are still looking. If you want to be able to change the toggle to be intractable or not, you can change that through script by getting the toggle component and setting interactable to false if your current currency amount is less than the item cost amount. What I would do is probably have a bool to check whether the item has been purchased or not when clicking the toggle, and if the toggle is clicked it will set the bool to true so the player can no longer purchase that item again. Personally, I handle buying items through a Button component since the Toggle is looking for a boolean variable to toggle between true or false. What I use toggles for are things that have an on or off value such as selecting windowed mode or full screen mode or tutorials on or off. I hope this helps a little bit for you.
@creatingwithlove
3 жыл бұрын
@@ryanbeattie9170 Thanks for responding. I did eventually figure it out, but it's good to have an explanation for others in this.
Пікірлер: 17