Перейти к содержимому

How to Use Dictionaries in Unity and C# [BEGINNER FRIENDLY]

Wild Cockatiel Games

0:00 / 0:00

How to Use Dictionaries in Unity and C# [BEGINNER FRIENDLY]

10 892 просмотра · 5 л. назад
Wild Cockatiel Games
5,18 тыс. подписчиков
10 892 просмотра · 5 л. назад
Let's make a 2D Platformer in Unity. Click HERE:    • How to Make a Game in Unity [FOR BEGINNERS]   In this video we'll be taking a look at how to use dictionaries in Unity and C#. I encourage you to watch the whole thing, but you can use the timestamps to skip to the relevant sections: Support: ❤️ Support me on Patreon:   / jholowka   _________________________________________________________________________ Affiliate Links: 🕹️ 2D Unity Course: https://fas.st/t/GBzzi3t3 🧱 3D Unity Course: https://fas.st/t/eZ9DNY1j 🌐 Multiplayer Unity Course: https://fas.st/t/sPS5D9G9 ✨ Game Feel Unity Course: https://fas.st/t/4bUZtTo6 🧬 Procedural Level Generation Unity Course: https://fas.st/t/kvG2bkTH 📚 Browse ALL GameDev.TV Courses: https://fas.st/t/id4NpGxc NOTE: These are affiliate links to GameDev.tv courses I strongly recommend if you want to level up your game dev knowledge. I personally started learning all of my GameDev through this organization, and I cannot recommend them enough. If you purchase through my links, I make a small commission, at no additional cost to you. This helps support me as a creator. Thank you so much if you do make a purchase! _________________________________________________________________________ 0:25 - Goals of the video 1:15 - What is a C# dictionary? 3:12 - Example of dictionaries in Portal Galaxy (front-end) 3:55 - Example of dictionaries in Portal Galaxy (back-end) 5:47 - When to use a dictionary 7:47 - Working example of how we will code a dictionary (front-end) 8:27 - Working example of how to code dictionaries (back-end) 10:12 - How to DECLARE a dictionary 10:34 - How to ADD to dictionaries (simple way, may cause errors) 11:29 - How to RETRIEVE values from dictionaries (simple way, may cause errors) 13:37 - How to ADD to dictionaries (advanced way, prevents errors) 15:22 - How to RETRIEVE values from dictionaries (advanced way, prevents errors) 18:17 - Wrap-up This can be an awfully complicated topic so I wanted to present this with plenty of examples and break it down so even beginners can understand the power of dictionaries, and know exactly how to implement them. Dictionaries consist of two parts. A KEY and a VALUE. The key is used to retrieve a specific value from the dictionary, making them incredibly useful tools for accessing information you want, without any of the clutter in the way. Music Attribution at video start: Shades of Spring by Kevin MacLeod Link: https://incompetech.filmmusic.io/song... License: https://filmmusic.io/standard-license