Make a Confirmation window in Unity in 6 minutes! [Tutorial]
Vložit
- čas přidán 13. 09. 2024
- Make a confirmation window in Unity
Be sure to check out my Unity for Complete Beginners course on Udemy here: www.udemy.com/...
Welcome to MetalStorm Games where you will learn how to make 2D and 3D games using the Unity Game Engine. My channel has a focus on Game Development for the beginner to intermediate level of programmer and game creator using C#. Please click the subscribe button if you would like to follow for more game development guides and tutorials, there will be complete beginner series and courses coming in the near future.
In this video we make a Confirmation or Notification window in Unity that is modular for multiple uses in 6 minutes. We will add Listeners via code to the menu so that you can change what each button does without needing the editor window.
After the tutorial I explain a few more advanced uses you can add in to this to make it much more modular in the future.
Free UI assets from Kenney at : www.kenney.nl/...
Discord Server
/ discord
Twitter
/ metalstormgames
#Unity #GameDev #Tutorial
The explanation was so so good and simple. Thanks.
Glad to hear that it was easy to follow. I am still learning a lot on how to explain these concepts so I appreciate hearing it helped out.
Great tutorial on listeners and pop-up, thanks for the learning opportunity.
Thanks for watching and glad it helped you out.
Great explanation, straight to the point. Good work!
Thanks, glad it helps
Awesome and helpful tutorial!
Thanks, Great tutorial! Ready for a follow up version that uses delegates, statics and/or singleton pattern.
Thanks, I do need to make a better one soon that is more event driven.
you're doing great man keep it up! deserve more subs def
Thanks I really appreciate it and thanks for watching
Great tutorial, should be helpful in making just about any type of game! I think I prefer this style, because it can be expanded on in future videos if the content calls for it.
Thanks for the feedback
Fast and simple, I like it.
Thanks, I think I will stick to a format like this
One thing I forgot to cover in the video is that when you are done with the confirmation window you will want to remove the listener from each button so that if you call it again from another script it will not run the methods in both scripts (unless that is what you want it to do). You remove a listener with the code "onClick.RemoveListener".
Please leave any comments below about which method of tutorials you prefer, ones that are a bit longer and explain things in more detail or quick and to the point like in this one. Thanks for watching.
How can i get which button is clicked from another script?
@@RAY-vd9ep That one gets a bit trickier when starting but you may want to do a search on Events and you could use an event that gets triggered when the button is pressed.
@@RAY-vd9ep Its not the best but you could also do something like just make some public bool values on a script that handles the buttons and set the bools to be true for whichever button is clicked. Then you could get a reference to that script from the other one you wanted to check it from. Not a very clean option but it would work fine as well.
Good stuff!
Thanks, looking forward to seeing what you post in the future as well.
I think it's not so good example... It's hard to use. A much better way is to use delegates. In this case, any object can show any confirmation and use it in a way that is needed.
Thanks for the feedback, I agree completely I was just trying to keep this one simple for beginners but I think I might make another video showing a bit more you can do with it by extending it.
ConfirmationWindow is erroring. Why?
Will need more details, what point are you having a problem with? the error message will usually describe what the issue is in the message. Provide the error message details and can try to help out troubleshooting. You may want to rewatch the video as well just to make sure you didnt miss something. Majority of the time its a small step that gets missed.
Sorry but I don't think this is a very clean solution. It's not reuseable at all, would be much better to be able to re-use one confirmation-window in different scenarious and trigger different methods without the need to implement the whole system again...
You are definitely correct in that, this was aimed at very beginner level and to not be confusing or complex but the downside to that is that it is not very modular.