Generics in C# and Unity - Do More with Less Code

Опубликовано: 14 Январь 2021
на канале: One Wheel Studio
13,037
581

Generics in C# and Unity help reduce code duplication by reusing the same code for different types. This means less code to write, less code to debug and your project can get finished sooner. We'll look at generic functions, generic constraints, and generic classes within C sharp.

Written Blog Post on Generics: https://onewheelstudio.com/blog/2020/...

Tutorial Code: https://github.com/onewheelstudio/Adv...

C# Constraints: https://docs.microsoft.com/en-us/dotn...

Thank You!!!
►► Владимир Перепелицын for subscribing! ||||||||||||||| 121% ||||||||||||||| 24.3K/20K
►► Michael Linzenmeyer - Spoke in the Wheel for being the newest channel member!
►► Jeremy Wolf - Spoke in the Wheel for being the newest patron!

Want to support the Channel?
*******************************
Shop the Unity Asset Store (affiliate): https://assetstore.unity.com/top-asse...
Become A Channel Member:    / @onewheelstudio  
Or a Patron:   / onewheelstudio  
Grab a T-Shirt: https://onewheelstudio.com/merch/
My video and streaming kit: https://kit.co/onewheelstudio/tutoria...
Buy a Game Design Books: https://kit.co/onewheelstudio/game-de...

Other Links
************
Discord: http://discord.onewheelstudio.com
Twitter:   / onewheelstudio  
Devlog: https://onewheelstudio.com/
Twitch:   / onewheelstudio  

Timestamps
*************
0:00 Generics Intro
2:09 Custom Generic Function
5:26 Calling Generic Functions
5:53 Generic Constraints
6:46 Destroy Objects of Type
7:32 Object Type Under Mouse
8:26 Multiple Arguments
9:18 Multiple Constraints
9:39 Generic Classes
10:46 Generic Object Pooling
11:42 Generics vs. Inheritance

#CSharp #BetterCode #GameDevelopment #Unity #generics #unitygenerics