What are Value Types and Reference Types in C#? (Class vs Struct)

preview_player
Показать описание
✅ Let's learn what are Value Types and Reference Types in C#
This is extremely important to know especially when working with Unity DOTS which uses Structs (Value) and not Classes (Reference)

If you have any questions post them in the comments and I'll do my best to answer them.

See you next time!

#unitytutorial #unity3d #unity2d

--------------------------------------------------------------------

Hello and welcome, I am your Code Monkey and here you will learn everything about Game Development in Unity 2D using C#.

I've been developing games for several years with 7 published games on Steam and now I'm sharing my knowledge to help you on your own game development journey.

--------------------------------------------------------------------

Рекомендации по теме
Комментарии
Автор

Did you know the differences between the types? How many times have they confused you?
🎮 Play 7 Awesome Games (Action, Strategy, Management) and Help Support the Channel!

CodeMonkeyUnity
Автор

Countless hours wasted failing to debug and understand why my data was being changed, seemingly for no reason. Thank you so much.

zacharytorr
Автор

NOTE: Although string is a Reference Type, it behaves like a Value Type (immutable) When you assign a variable it receives a copy and not a pointer.

CodeMonkeyUnity
Автор

Definetely the most underrated programming channel on the platform. Stunning content

mrmogelost
Автор

This video should be the first on the playlist. Just an advice.

katifurkan
Автор

Thanks, I've been struggling to figure out how c# was structured, and how to manage instances, this helped a TON!

connormyers
Автор

This is exactly what I needed! This problem had been vexing me for a while, thanks a bunch

thedeltastrat
Автор

THANK YOU!! I never understood why I had to keep declaring new whatever type until now.

sanc
Автор

This clarified the difference between value types and reference types really nicely, thank you.

JKhalaf
Автор

Excellent video, which I wish I had when I started C #.

Thank you for all these videos!
(I bought Clean Code. I did not keep very good memories of my last big book in English, but this kind of book is rarely translated into French).

jean-michel.houbre
Автор

I just found this video useful as a reference for a college forum discussion. Thanks CodeMonkey!

jtlewis
Автор

This is extremely useful! I was encountered this problem before and it is so frustrating

vrtech
Автор

Just want to say thank you. Great tutorial!

siestitrokot
Автор

Value types are bytes of data that contain values in memory, reference types are addresses to bytes of data in memory. Reference types are pointers (C/C++) to an address, and variables/fields store data.

mr_noodler
Автор

awesome explanation CM love your videos . keep making more Awesome videos on C# unity like this

neozoid
Автор

Thank you so much for making these tutorials :)

gladiumcaeli
Автор

Great vid, thank you. One improvement could be a little diagram which pops up which shows what's going on 'under the hood'. in relation to the reference pointers/value copies.

daveB
Автор

Thank you for the explanation! You have some really high quality content.

williamiiifarquhar
Автор

love your videos you're great! keep making more!

zoobs-yx
Автор

awesome tut ;) please make tuts for design pattern in unity

johnnythesilverhand