New C# Features in Unity

preview_player
Показать описание

As of Unity 2021.2, you now have access to some new C# features in Unity. This is thanks to improved support for .NET Standard 2.1 which has given us Unity developers the ability to use all of the features available in C# 8.0. In this video I'll cover a handful of programming features that I think are the most interesting.

00:00 Introduction
01:18 Sign up for the Level_2 Game Dev Newsletter
02:10 Readonly Members
06:00 Default Interface Methods
08:42 Indices and Ranges
11:12 Conclusion

💬 Join Our Community

❤️ My Favorite Unity Assets *

* Disclosure: These are affiliate links, which means I'll receive a commission if you use them to make a purchase.

* Disclosure: These are affiliate links, which means I'll receive a commission if you use them to make a purchase.
Рекомендации по теме
Комментарии
Автор

Made it into the friends list! :)

Great video btw!

UnitydCollege
Автор

That sweet sweet syntactic sugar! Thanks for another awesome video, Charles! Your videos are one of the few I make sure to watch from start to finish because literally everything you explain has value.

iHeartGameDev
Автор

My issue with default interface method is that it starts to blur the line between abstract classes and the classical definition of an interface (i.e. interface is a contract).
I've honestly ran into interesting design pattern problems where I really wanted to have a default interface method, but then I thought it was a bad design from my part that trapped me in that corner.
Even though I know that this is more of C# discussion rather than Unity discussion, but I'm curious to hear/read your opinion about it :)

happypixls
Автор

Very clear. An additional part would be welcome, your introduction is perfect for tackling the documentation effectively. Thank you.

jean-michel.houbre
Автор

I'm so glad you mentioned the Jasons, I had a fear you were no longer on good terms. I really miss your chats with Storey, as you two had so informative correspondence with each other.

wendten
Автор

I think using minus ( example: "carrots[-5]" ) rather than ^ would be a lot easier to reason about. But still a cool feature :)

INeatFreak
Автор

10:41 the line 15 seems to be a little wrong. It would print first four elements, not five as the end index is exclusive.

BorisNovikov
Автор

Default Interface Methods is definitely my new favorite feature.

LipeSK
Автор

When this video was posted, I didn't understand a single thing of it. 3 months later, after studying like hell, I still don't get it... lol, jk. It's so cool to be able to understand every single bit of the video. I feel proud of what've accomplished in these 2 months, helps to fight the depression and impostor syndrome. It means a lot to me.

It wouldn't have been possible without awesome people like: Charles, SamYam, and all other other amazing youtubers out there. Thanks!

ElboxD
Автор

Thanks for sharing! Deafult Interface methods call my curiosity ;-)

rafa_guitar
Автор

This is the content I'm here for. ✨

AlanZucconi
Автор

That array thing ^ .. will be helpfull

VEOdev
Автор

it sucks that we don't access to c#10or at least 09.There's just so much more added in both versions but at least we're Unity is moving forward with the changes. I just recently starting using Unity, and it's been a nice experience, but Im biased given that I already know 2 other engines, Godot and gamemaker studio 2. It feels great to use my beloved C# in an engine like Unity.

Thanks a lot for the video!

Gbtx
Автор

Did you reupload this video? I saw it once before and I don't think it was uploaded that recently then. If so, is this a setup for a part 2? 😁

rickyfreddy
Автор

@10:45 If what he is saying here is correct, wouldn't that line be incorrect? Shouldn't it be "First Four:" if the end range number is exclusive?

dragonlance
Автор

Correct me if I am wrong, because it appears you have lost the plot.

Unity introduce C#8 into Unity 2020.2, or at least the vast majority of that support. And as of Unity 2021.2, they introduce a small subset of C# 9.0, so I am confused how they then snuck this up to C#10 when not even all of C#9 is supported as yet?

And C#11 is not even finalised and no work has even begun on that as yet.

Did you have too much to drink New Years Eve?

And 2 of the 3 things you mentioned I have specifically been using since Unity 2020.2, the other I am not 100% certain it was in that version of Unity.

CyberAngel
Автор

I've subscribed to "Level 2 Game Dev Newsletter" since you announced it and I have not received any newsletter yet?

zeeshansattar
Автор

Nice video, thanks for the info. FWIW, melee is not pronounced "me-lee", it is a French word and pronounce "meh-LAY".

christopher
Автор

Great video Charles! Definitely looking forward to trying out some of those new array tricks :)

ThousandAnt
Автор

Whoa. Now how long till 2021 comes LTS ?

saeedbarari