A lot of people were having trouble understanding the Singleton script, mainly "T" and "where T: MonoBehaviour" (maybe not so much with the singleton pattern itself, so this is NOT a video on singletons) If you're looking for a singleton script, check out my files here (Singleton included): drive.google.com/drive/folders/17Lfpa5r-3zeR1jaT0eJ4nqIR3pkU9ABE?usp=sharing T refers to generics where you don't have to specify a single class or a method. I use T for the Singleton class because I don't know which classes are going to inherit from it (CharacterManager, VirtualInputManager, CameraManager, etc). Generics allow different managers to inherit from the same Singleton class. It's like saying "a class can inherit from Singleton, where that class has to be a MonoBehaviour". After watching this video, if you're still having trouble understanding the code, I'll create another video for singletons. For now check out this video: ua-cam.com/video/hUE_j6q0LTQ/v-deo.html EDIT: here's my video on singletons ua-cam.com/video/92NQVeFiDeY/v-deo.html Download my project: github.com/RoundBearChoi/2.5D_Platformer_Unity Tutorial playlist: ua-cam.com/play/PLWYGofN_jX5BupV2xLjU1HUvujl_yDIN6.html
THIS! This is what I'm talking about, too many times people doing tutorials just waffle on and on, without enough demostration, however this good gentleman knows how to do a great tutorial. I'm in Godot C# but I can apply this over. Thank you :)
It's one of the reason, that there are tons of unfinished, buggy or asset flipper games with made Unity out there. Respect to this guy to making these types of videos.
@@Roundbeargames Hi, This line copyObj.AddComponent(); would it be possible to get all the components on an object and not only the script attached(rigidbody,mesh etc). Just curious if it can be done in this case. excluding instantiate a prefab. Hope this makes more sense. Thank you.
you can attach MeshFilter and MeshRenderer to an empty gameobject. then you'll need to assign mesh and material in order to render it. yes you can add components through AddComponent
@@Roundbeargames The fact that you're always trying to become a better programmer, and shares your skills / work with us, makes you the best in my eyes :)
The examples given are perfect for me, I was looking for something like this and your explaination helped me find a solution for what I was looking for, thanks a lot! :)
thanks i'm glad to hear that. these are extremely simple examples so i dunno if they're gonna have any use cases other than explaining the basics. but i hope you have fun!
These are the tutorials that people really need to be trying to research. You just helped me take a system I'm trying to make more modular, and make it more efficient. One more tool in the toolbox. Well done, as always.
@@Roundbeargames I've been making things as generic as possible where compatability issues may arise with other systems from other authors, like damage messeges(ApplyDamage, GotHit, Damage.ect...), so I add string list for them to make those changes in the inspector. This will help immensely with trying to anticipate those scenarios, Thank You.
You are my hero!!! s2 Question: at 7m50s, Why all the classes were called? Where it´s been called? You just have to inherit it? I couldn´t make sense out of this yet
docs.unity3d.com/ScriptReference/MonoBehaviour.Start.html start() awake() etc Its one of those magic functions. Id recommend learn programming first before trying to make sense out of unity :)
Start triggers Declare. Declare triggers AddComponent, adding the script to its own game object. Start triggers Declare. Declare triggers AddComponent, adding the script to its own game object. Start triggers Declare. Declare triggers AddComponent, adding the script to its own game object.
A lot of people were having trouble understanding the Singleton script,
mainly "T" and "where T: MonoBehaviour"
(maybe not so much with the singleton pattern itself, so this is NOT a video on singletons)
If you're looking for a singleton script, check out my files here (Singleton included):
drive.google.com/drive/folders/17Lfpa5r-3zeR1jaT0eJ4nqIR3pkU9ABE?usp=sharing
T refers to generics where you don't have to specify a single class or a method. I use T for the Singleton class because I don't know which classes are going to inherit from it (CharacterManager, VirtualInputManager, CameraManager, etc). Generics allow different managers to inherit from the same Singleton class. It's like saying "a class can inherit from Singleton, where that class has to be a MonoBehaviour".
After watching this video, if you're still having trouble understanding the code, I'll create another video for singletons.
For now check out this video:
ua-cam.com/video/hUE_j6q0LTQ/v-deo.html
EDIT: here's my video on singletons
ua-cam.com/video/92NQVeFiDeY/v-deo.html
Download my project:
github.com/RoundBearChoi/2.5D_Platformer_Unity
Tutorial playlist:
ua-cam.com/play/PLWYGofN_jX5BupV2xLjU1HUvujl_yDIN6.html
Thanks a lot. This is the first time I am able to understand this concept.
that's good to hear. i hope you have fun in your journey :)
THIS! This is what I'm talking about, too many times people doing tutorials just waffle on and on, without enough demostration, however this good gentleman knows how to do a great tutorial. I'm in Godot C# but I can apply this over. Thank you :)
i dont have experience with godot but that sounds great :) i also go on and on with my tutorials series but oh well i hope you enjoy!
It's one of the reason, that there are tons of unfinished, buggy or asset flipper games with made Unity out there. Respect to this guy to making these types of videos.
@@klarnorbert thank you. Yea people try things and give up too quickly i guess 😂
this the best video i have found about this topic, very nice!
Thank you. I hope you enjoy!
Good afternoon my bro, Would it be possible to get both the mesh rendered and mesh filter using this method? sorry if i dont make much sense.
this video has nothing to do with meshes. i have no idea what you're asking.
@@Roundbeargames Hi,
This line copyObj.AddComponent(); would it be possible to get all the components on an object and not only the script attached(rigidbody,mesh etc). Just curious if it can be done in this case. excluding instantiate a prefab. Hope this makes more sense. Thank you.
you can attach MeshFilter and MeshRenderer to an empty gameobject. then you'll need to assign mesh and material in order to render it. yes you can add components through AddComponent
@@Roundbeargames Thank you.
한 주 동안 수고 많으셨어요~^^ 💙
힘찬 월욜 맞이하셔요~!
캄사합니다 ^ㅅ^
오늘은 쬐끔 피곤하지만 월욜도 화이팅!
Absolutly the best tutorials. Thank you for uploading, you are doing a lot for the community :)
thank you :) atm i'm focused on my own projects but i hope you enjoy the videos!
Thanks!! I'm trying to make a generic function for custom classes that all inherit from one custom class - hoping what you teach here helps
thanks for comin! i hope you have fun learning!
if you are learning unity and you are new to C#, C# must be learned first. Very nice explanation!!!
yes and if you have time i also recommend c/c++/2d libaries/directx/etc and more! :)
Best usage example of generics I've seen...and I've seen a lot. Added to my unity playlist of must watch
that's awesome. i hope you enjoy the playlist!
and a lot of what i have is from googling stuff that came before me.
Added to my Unity Favorites Playlist too.lol
this is really easy to Understand. Thank's...
Thats good to hear. Enjoy! 😃
Your Tutorials are awesome.Thank you.
thanks. i hope you enjoy!
You are the best man
i wouldn't say best but thanks! :)
@@Roundbeargames The fact that you're always trying to become a better programmer, and shares your skills / work with us, makes you the best in my eyes :)
@@CaverHTC wow thank you. but i do feel like there's so much music and short clips from indie game developers but not enough opensource projects.
The examples given are perfect for me, I was looking for something like this and your explaination helped me find a solution for what I was looking for, thanks a lot! :)
thanks i'm glad to hear that. these are extremely simple examples so i dunno if they're gonna have any use cases other than explaining the basics. but i hope you have fun!
thanks bro, great content and easy to understand
thanks that's good to hear!
excellent! keep up the small concise topics.. its really good for users of unity to look up on YT!
thank you! i do try to keep every video to a single topic, tho that leads to lots of volume.. :)
These are the tutorials that people really need to be trying to research.
You just helped me take a system I'm trying to make more modular, and make it more efficient.
One more tool in the toolbox.
Well done, as always.
thanks. i might have more later :)
and topics depend on what people ask/suggest
@@Roundbeargames I've been making things as generic as possible where compatability issues may arise with other systems from other authors, like damage messeges(ApplyDamage, GotHit, Damage.ect...), so I add string list for them to make those changes in the inspector.
This will help immensely with trying to anticipate those scenarios, Thank You.
that's awesome. this video only shows extremely simple examples. but good luck!
buen video ,excelente
thank you
Loving this series so far, all the advance stuff and clear explainations.
i'm happy to hear that. have fun in gamedev!
You are my hero!!! s2
Question: at 7m50s, Why all the classes were called? Where it´s been called? You just have to inherit it? I couldn´t make sense out of this yet
docs.unity3d.com/ScriptReference/MonoBehaviour.Start.html
start() awake() etc
Its one of those magic functions.
Id recommend learn programming first before trying to make sense out of unity :)
in the second example, in the line that this code written : copy.Addcomponent(T), its create a loop, i cant see any loop, could you explain the loop
Start triggers Declare.
Declare triggers AddComponent, adding the script to its own game object.
Start triggers Declare.
Declare triggers AddComponent, adding the script to its own game object.
Start triggers Declare.
Declare triggers AddComponent, adding the script to its own game object.
ty :)
:)
Came here a bit confused after watching the Unity Learn video on generics. These examples were super helpful. Thanks so much!
that's good to know! i hope you have fun in gamedev!
amazingly clear, thank you, best generics example I've found after years of lookin
Glad it was helpful!
I love that there are sooo many things that I still don't know about. It adds so much more will to learn. Very cool!
well we just gotta keep learning!
I agree 100%, it's exciting the first time you come across something you can actually use.
Man, I'm just starting to work on a project with my brother and all of your videos have been super helpful. Can't say thanks enough.
that's very good to hear. if you're spending time on my channel that's already a big thanks. i wish you luck with your project.
Great video with excellent examples!
Thanks! :)
Thank you so much, for sharing this, i learn so much here :D
Thanks for comin! Enjoy! 😃