C# Lists and Dictionaries in Unity! - Intermediate Scripting Tutorial

preview_player
Показать описание
Watch this video in context on Unity Learn:

Lists and Dictionaries are two types of generic collections. These collections give you a broad array of functions that allow you to manage and maintain your data. In this video you will learn how to create lists and dictionaries. You will also learn about some of their functionality.
Рекомендации по теме
Комментарии
Автор

Started C# and Unity about a month ago, really love lists.

nosirrahx
Автор

So you made a unity tutorial about dictionaries and left out the most salient point about them, the fact they don't serialize in unity and will not show up in the inspector. Either you are aiming this at beginners for who that disparity in behavior will be confusing or you expect them to understand that but not what a key or sort function is.

JasonStorey
Автор

Wow, I didn't know you could manipulate the Sort() function via the CompareTo thing.

quasar
Автор

What about modifying lists or dicts during a foreach loop, can you not explain how to do that safely?

gregoryfenn
Автор

Considering how much unity devs hate dictionaries, I'm surprised they are even mentioned in tutorials.

oldcat
Автор

Thanks Unity great video, love your game egnine

mktutorials
Автор

Wait... But aren't dictionaries datatype being deprecated on the new ECS for better performance? I love using dictionaries datatypes for localization, and I thought I would need something else. 🤨🤔

mechanicallydev
Автор

I need to click on the button and create a public list that will be displayed in the inspector. Please help me!🙏🙏🙏

lora
Автор

It's showing warning, you are trying to create a monobehaviour using new keyword

DetectiveRyku
Автор

How is this better than just using standard variables?

sveinndagur
Автор

So you're a tough script,
Like it really rought script,
Just can't get enough script,
Function always puff script,
I'm that bad code,
Make your mama sad code,
Make your PC mad tight,
Might seduce your dad script,
I'm the script, duh.

VoodooMadMike
Автор

sorry but why did you create the function which called "CompareTo" without using it at all?
and please where can i find more effecient information about Dictionaries

omaralkaley
Автор

Is there a way to add multiple things to a list like adding 20 items in one line or do i just have to repeat that line 20 times?

mrb
Автор

wow you guys speak like you code, without real explanations and just references

RegenerationOfficial
Автор

Hi!
Can you help please?

I'm making a serializable list "picInfo", and want to have 3 PicsInfo 'items' set within the script. is it possible?

[System.Serializable]
public class PicInfo
{
public List<PicsInfo> PicsInfo = new List<PicsInfo>();
}

[System.Serializable]
public class PicsInfo
{
public string PicLeft;
public string PicRight;
public string PicBottom;
}


public class Name : MonoBehaviour
[SerializeField] public PicInfo PicInfo;

partumorbis
Автор

yep there is no way I'm going to know when to use a list or dictionaries for game ideas which these tutorials showed real game examples using free assets or the free unity game projects to demonstrate...

TheNamesJT
Автор

Bad guys Harvey and Magneto I see what you did there

rtxarkham
Автор

Unity tutorials made by Unity is trash compared to Unity tutorials made by other youtubers

goldencookie
Автор

This can be used to order a list of a given type by any variable of that type.
Okay, I have a joke for you...
Who's on first, what's on second, they're on third.
Listen, if you want to teach something to someone you speak clearly, slowly, relate the information to something they already know.
I've had to repeat this sentence I wrote at the top several times and it still makes no sense.
Bla blabl balbal ablbla bla bla bla.
That's what I understand.
Thanks a lot. You don't have an aptitude to teach.
Please hand over the reins to someone who does.

technofeeliak