You Should Be Using Generics!!! (C# and Unity)
One Wheel Studio
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.
Tutorial Code: https://github.com/onewheelstudio/Adventures-in-C-Sharp/tree/main/Generics
C# Constraints: https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/generics/constraints-on-type-parameters
Become A Channel Member: https://www.youtube.com/channel/UCkr9CPPqT9VWUjkpo3HcACg/join T-Shirts: https://onewheelstudio.com/merch/ My video and streaming kit: https://kit.co/onewheelstudio/tutorial-video-production Recommended Game Design Books: https://kit.co/onewheelstudio/game-design-reading-list-unity-c-blender-and-more
Discord: http://discord.onewheelstudio.com
Patreon: https://www.patreon.com/onewheelstudio
Twitter: https://twitter.com/OneWheelStudio
Devlog: https://onewheelstudio.com/
Twitch: https://go.twitch.tv/onewheelstudio
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 ... https://www.youtube.com/watch?v=6ED4Qo0Yi6o
94937854 Bytes