Loops and Arrays | Unity C# Basics Part 2 | Unity Tutorial

preview_player
Показать описание
Learn about some critical fundamentals - Arrays and Loops. They usually go hand in hand so it just felt right to talk about them together. In this tutorial, aimed at absolute beginners who have very little to no coding experience whatsoever, you'll learn:
⚫ What Loops are.
⚫ What kinds of Loops are available in C#
⚫ A step-by-step breakdown of what each statement is doing, why it's happening, and how it works.
⚫ How to make multiple TextMeshProUGUI components on the screen count up over time from a single script

📝📝📝YOUR HOMEWORK!📝📝📝

Update this script so will display the updated TimeDisplay on only a single TextMeshProUGUI component on a frame.

On frame 1, the first TextMeshProUGUI component should display the TimeDisplay

On frame 2, the second TextMeshProUGUI component should display the updated TimeDisplay, the first TextMeshProUGUI component should still show the last TimeDisplay value.

On frame 3, the third TextMeshProUGUI component should display the updated TimeDisplay, the first TextMeshProUGUI component should still show the first TimeDisplay value, and the second TextMeshProUGUI component should display the last value.

etc... through the end of the TextMeshProUGUI components. Once we've reached frame 8 (since we only have 7 TextMeshProUGUI components) it should update the first TextMeshProUGUI component again and continue with this pattern.

This should work for any number of TextMeshProUGUI components, or any size of the Texts array.

Add a comment below with a video showing your code and the end result.

📚 For those looking to get ahead of the next video, consider some further reading on resources I brought up during this tutorial 📚

🧡 Believe in LlamAcademy's mission and have received value from the videos? Here's how you can show your support:
📚 Take my Unity ShaderGraph Course:

Some links may be affiliate links, which at no additional cost to you, gives me a small portion of the purchase.

Chapters:
00:00 What to Expect
02:45 Review Scene
03:33 Array Introduction
06:50 The FOR Loop
11:33 Demo
12:40 The WHILE Loop
15:57 The DO WHILE Loop
18:32 The FOREACH Loop
20:06 Array Creation and Assignment
22:22 Homework, Last Homework Answer, and Final Thoughts
Рекомендации по теме
Комментарии
Автор

I've struggled for a year now, your videos are the only things that have truly helped me to learn... thanks so much for this content.

MM-bwlo
Автор

You have a great way of explaining stuff. I really enjoyed the video. I hope you will continue with the series. Thank you!

Ma_cieK
Автор

Thanks for your efforts, we are really appreciated. Can u explain later on how to make enemies flying after get punched? With and without ragdoll??

a.technology
Автор

I noticed in your first video to this one you've changed the SetText portion of your code to include $"{TimeDisplay... Why is that?

jlonginotti
Автор

I'm kinda lost here, where did you define the length of the array [] text

Mr_cat_lord_of_the_underworld
Автор

hi best videos bro you're so helpful
I've got a question how did you get that background I've the previous video but i still didn't get it pls explain in reply or new video

verrbpn
Автор

Did you provide the solution anywhere to the homework assignment at the end of Part 1?

obsoletevalues
Автор

Hii!, For loops are a little hard. I dont really understand them but lets hope after this video i do!

jellybeann
Автор

these things gave me nightmares a while ago 😅

ronigleydsonvilasnovas
Автор

bro your hair changed from green to red

gamebaker
join shbcf.ru