Roundbeargames | C# Generics Explained - Unity Tutorial @Roundbeargames | Uploaded October 2019 | Updated October 2024, 2 hours ago.
C# Generics Explained - Unity Tutorial
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:
youtu.be/hUE_j6q0LTQ
EDIT: here's my video on singletons
youtu.be/92NQVeFiDeY
Download my project:
github.com/RoundBearChoi/2.5D_Platformer_Unity
Tutorial playlist:
youtube.com/playlist?list=PLWYGofN_jX5BupV2xLjU1HUvujl_yDIN6
Any questions/comments? Join us on discord:
discord.gg/hAFTgcA
Social
twitter: twitter.com/roundbeargames
facebook: facebook.com/roundbeargames17
hive: peakd.com/@roundbeargames/posts
reddit: reddit.com/user/roundbeargames
linkedin: linkedin.com/in/jangwon-choi-roundbeargames
Patreon:
patreon.com/roundbeargames
Channel Memberships:
youtube.com/roundbeargames/join
#gamedev #indiegame #unitytutorial #devlog
C# Generics Explained - Unity Tutorial
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:
youtu.be/hUE_j6q0LTQ
EDIT: here's my video on singletons
youtu.be/92NQVeFiDeY
Download my project:
github.com/RoundBearChoi/2.5D_Platformer_Unity
Tutorial playlist:
youtube.com/playlist?list=PLWYGofN_jX5BupV2xLjU1HUvujl_yDIN6
Any questions/comments? Join us on discord:
discord.gg/hAFTgcA
Social
twitter: twitter.com/roundbeargames
facebook: facebook.com/roundbeargames17
hive: peakd.com/@roundbeargames/posts
reddit: reddit.com/user/roundbeargames
linkedin: linkedin.com/in/jangwon-choi-roundbeargames
Patreon:
patreon.com/roundbeargames
Channel Memberships:
youtube.com/roundbeargames/join
#gamedev #indiegame #unitytutorial #devlog