WEBVTT

00:00.080 --> 00:00.500
Hello guys.

00:00.500 --> 00:01.520
Welcome to the video.

00:01.520 --> 00:05.030
In this one I want to show you how to set up difficulty for the game.

00:05.030 --> 00:09.650
You're going to have a very simple setup, but it's pretty fun to make and pretty fun to play I believe.

00:09.650 --> 00:14.270
So what we're going to do here, we're going to have easy, normal and hard mode.

00:14.360 --> 00:17.450
Easy mode will be is the same as we have the game now.

00:17.450 --> 00:22.160
On a normal mode, you're going to lose fruits every time you get in damage or every time you fall into

00:22.160 --> 00:22.700
a dead zone.

00:22.700 --> 00:25.550
And if you have zero fruits, we're going to restart the level.

00:25.550 --> 00:30.440
And on a hard mode, no matter how you got the damage, you're going to restart the level from the beginning.

00:30.440 --> 00:31.700
That's what I want to do.

00:31.820 --> 00:35.360
So how are we going to pass info to the game?

00:36.390 --> 00:41.790
So first let's set up the difficulty so we can set the difficulty and pass it to the main scene.

00:42.180 --> 00:45.000
And I think we have two options here.

00:45.000 --> 00:47.940
One of them is to create a difficulty manager.

00:47.940 --> 00:55.440
Another option is to just rename this skin manager to Settings Manager and have everything in one script.

00:55.440 --> 00:58.740
There is no right or wrong choice here, but I'm a bit limited.

00:58.770 --> 01:04.740
I want this course to be as understandable as it can be, and I know that sometimes people go in the

01:04.740 --> 01:08.280
end of the section and they download the project, and it may happen.

01:08.280 --> 01:13.530
It will be difficult for them to find that skin manager was renamed to Setting Manager.

01:13.530 --> 01:15.270
It can take some time to figure out.

01:15.270 --> 01:18.150
So I want to make a new game object for this.

01:18.150 --> 01:24.030
But for personal project most likely I will do everything like setting manager and I would save everything

01:24.030 --> 01:24.300
there.

01:24.300 --> 01:27.810
Maybe we can do that later on on a cleanup or on the Polish stage.

01:28.110 --> 01:30.450
Now, uh, let me do this.

01:30.450 --> 01:35.130
Let's go and make empty object difficulty manager.

01:36.870 --> 01:38.520
Then we're going to need a script.

01:41.130 --> 01:43.440
Difficulty manager.

01:48.160 --> 01:50.050
I'm going to drag it here.

01:50.560 --> 01:52.330
Let's go inside of the script.

01:57.090 --> 02:00.660
And at the top we're going to declare the enum public enum.

02:01.670 --> 02:04.310
Difficulty, uh, type.

02:06.200 --> 02:07.580
It's going to be easy.

02:08.190 --> 02:09.210
Normal.

02:09.910 --> 02:10.510
Hard.

02:11.220 --> 02:18.810
Then we're going to make it as public static difficulty manager instance, and we're going to need a

02:18.810 --> 02:21.450
wake from a screen manager over here.

02:21.450 --> 02:23.790
That's why I said we can do everything in one script.

02:27.300 --> 02:29.490
Because they pretty much have same functionality.

02:30.150 --> 02:31.350
Uh, yeah.

02:31.350 --> 02:32.010
What is it?

02:32.010 --> 02:35.550
Instance in sense?

02:35.580 --> 02:36.360
Okay.

02:37.960 --> 02:40.780
Now let's make um public.

02:41.170 --> 02:42.040
Enum.

02:42.100 --> 02:44.230
No public difficulty type.

02:45.280 --> 02:46.360
Difficulty.

02:46.920 --> 02:51.030
And we want to have a method that would help us to set up this difficulty.

02:51.030 --> 02:54.060
So public void set difficulty.

02:54.210 --> 02:57.300
We're going to do difficulty type difficulty equals to.

02:59.360 --> 03:01.070
Let me do new difficulty.

03:03.240 --> 03:06.780
You're going to be difficulty equals to new difficulty.

03:06.810 --> 03:07.770
Perfect.

03:07.770 --> 03:13.830
So now this will have information whenever we set parameter through the method through the button.

03:13.950 --> 03:15.210
And we need to.

03:16.160 --> 03:17.630
Make a script for buttons.

03:17.630 --> 03:23.690
So I'm going to go to UI and over here I'm going to make UI difficulty.

03:28.020 --> 03:28.680
Good.

03:28.680 --> 03:29.640
Very good.

03:29.640 --> 03:32.190
Let's go to this UI difficulty.

03:32.490 --> 03:36.810
And over here we want to get reference to the difficulty manager.

03:36.810 --> 03:38.370
So I'm going to the difficulty manager.

03:38.370 --> 03:39.840
Difficulty manager.

03:39.840 --> 03:45.150
In the start we're going to do difficulty manager equals to difficulty manager.

03:46.090 --> 03:47.440
Dot instance.

03:49.050 --> 03:51.600
Then we're going to do public void set.

03:51.630 --> 03:53.820
Easy mode.

03:56.790 --> 03:58.200
And it will do.

03:58.230 --> 04:01.800
Difficulty manager set difficulty to easy.

04:02.620 --> 04:04.840
Then we need public void set.

04:04.870 --> 04:06.010
Normal mode.

04:07.530 --> 04:10.980
Going to be difficult to manager said difficulty of normal.

04:12.180 --> 04:14.310
And public void set.

04:14.700 --> 04:15.720
Hard mode.

04:16.820 --> 04:20.360
And it's going to do difficulty manager set difficulty of.

04:21.410 --> 04:22.130
Hard mode.

04:23.270 --> 04:25.400
Cool half job is done.

04:25.760 --> 04:27.470
Let's go back to unity.

04:30.680 --> 04:36.560
And we need to take main menu, we can just duplicate it and enable it.

04:36.560 --> 04:38.420
Let's rename it to.

04:39.320 --> 04:40.640
Difficulty UI.

04:45.100 --> 04:45.970
Okay.

04:46.930 --> 04:49.690
Now let's go delete the continue button.

04:49.690 --> 04:52.300
We can take the new game button.

04:53.180 --> 04:55.100
Move it above.

04:55.340 --> 04:56.480
Duplicate it.

04:56.480 --> 04:57.530
Move it below.

04:57.560 --> 04:59.540
Duplicate it, move it below.

05:00.620 --> 05:01.580
All right.

05:01.910 --> 05:03.110
Looks good to me.

05:03.290 --> 05:04.520
Now let's name this.

05:04.520 --> 05:06.260
Too easy.

05:07.310 --> 05:11.960
Mode button, and I'm going to copy the name because I feel lazy.

05:11.960 --> 05:16.610
Paste it in here and do normal mode button and.

05:17.670 --> 05:18.870
Hard mode button.

05:20.650 --> 05:23.350
Okay, now we need to change the text.

05:24.960 --> 05:26.430
This will be easy.

05:28.010 --> 05:32.990
This will be normal and this will be hard.

05:33.800 --> 05:34.160
Cool.

05:34.160 --> 05:34.970
Love it.

05:35.390 --> 05:39.290
Now we need to and drag the script over here.

05:39.290 --> 05:40.850
UI difficulty.

05:41.710 --> 05:45.280
And let's go select these three buttons.

05:45.280 --> 05:48.190
Drag difficult to UI over here.

05:48.190 --> 05:57.220
And also I want to do plus drag canvas over here and choose new game so you can easily check the functionality.

06:00.180 --> 06:01.950
Then let's go here.

06:01.950 --> 06:04.890
Choose Set Easy mode.

06:04.890 --> 06:10.770
Then for the normal mode we're going to do UI difficulty set normal mode.

06:12.440 --> 06:16.190
And for the hard one set hard mode.

06:17.980 --> 06:19.420
Okay, cool.

06:19.450 --> 06:24.760
Now, um, we know it's supposed to work, but let's just check it just in case.

06:26.670 --> 06:29.400
I'm going to choose the hard mode and we're going to jump to a new game.

06:30.560 --> 06:35.000
And we have difficulty manager over here with the hard mode being chosen.

06:35.000 --> 06:35.660
Nice.

06:35.660 --> 06:39.500
Now let's go to asset scene level one.

06:39.500 --> 06:40.700
I'm going to save it.

06:42.010 --> 06:46.810
And first of all, I want to make a gap so we can check the falling damage as well.

06:50.710 --> 06:52.960
Uh, let me make a gap over here.

06:54.380 --> 07:02.780
Think that, and I want to take one of the traps from a prefab folder traps and put a spike over here.

07:05.910 --> 07:06.570
Okay.

07:07.200 --> 07:08.130
Very nice.

07:08.160 --> 07:09.480
Now what else?

07:10.930 --> 07:12.760
And now we need to grab the difficulty.

07:12.790 --> 07:14.200
From difficulty manager.

07:14.200 --> 07:16.870
But we don't have it in this scene.

07:16.870 --> 07:21.610
So for the test purpose, I'm going to make a difficulty manager.

07:24.410 --> 07:25.550
Difficulty manager.

07:25.550 --> 07:28.820
We don't have it because we run scene in a test mode in unity.

07:28.820 --> 07:34.490
But your player will never have the situation, so you can easily just make some sort of null check

07:34.490 --> 07:35.780
just to be sure we have it.

07:35.780 --> 07:40.580
And if you don't have it, we're going to test levels in easy mode and only developer will be able to

07:40.580 --> 07:41.240
do that.

07:41.840 --> 07:43.640
Okay so we have difficulty manager.

07:43.640 --> 07:45.440
Let's go to the player.

07:45.440 --> 07:49.550
And I think we can update the difficulty every time we respawn the player.

07:49.550 --> 07:53.780
There may be a better place for this, but we're going to have damage method on the player.

07:53.780 --> 07:57.020
So I think it's okay to do it in the player as well.

07:57.710 --> 08:00.110
Uh, let's go above over here.

08:01.380 --> 08:03.840
And I'm going to do private difficulty type.

08:05.100 --> 08:11.040
Game difficulty, and we probably going to need a reference to the game manager, because we're going

08:11.040 --> 08:12.780
to use game manager here.

08:13.080 --> 08:14.370
A couple of times now.

08:17.060 --> 08:21.230
Gonna go to the start method over here.

08:24.650 --> 08:29.780
Game manager equals to game manager dot instance and difficulty.

08:30.500 --> 08:36.950
I mean game difficulty equals to difficulty manager dot instance dot difficulty.

08:36.950 --> 08:42.410
And we just want to be sure we have uh difficulty manager in the scene.

08:42.410 --> 08:45.230
So I'm going to do if difficulty manager.

08:46.460 --> 08:49.580
That instance not equals to null.

08:50.770 --> 08:52.510
Any other way to do that.

08:53.440 --> 08:54.790
Let's do it this way.

08:54.820 --> 08:55.240
Let's do it.

08:55.240 --> 08:56.740
Difficulty manager.

08:58.520 --> 09:01.910
Difficulty manager and then if difficulty manager.

09:02.790 --> 09:07.140
Is not equal to null, then game difficulty equals to.

09:08.020 --> 09:08.530
Difficulty.

09:08.530 --> 09:10.000
Manager difficulty?

09:10.120 --> 09:10.870
Yes.

09:13.090 --> 09:15.190
And this all looks a bit confusing.

09:15.190 --> 09:17.290
So we can take this into a method.

09:18.700 --> 09:20.620
Extract method and do.

09:21.510 --> 09:24.900
Uh, update game difficulty.

09:25.260 --> 09:25.950
All right.

09:28.800 --> 09:30.540
Now you can see me on the screen.

09:31.230 --> 09:32.940
This all looks good to me.

09:33.480 --> 09:37.830
And maybe we can just drag this over here to make it prettier.

09:41.130 --> 09:44.010
Now we need to use difficulty and game manager as well.

09:44.010 --> 09:44.940
So.

09:46.950 --> 09:53.460
I think we can make some sort of damage method that will decide what is going to happen with the player

09:53.460 --> 09:55.020
when he's getting damage.

09:55.020 --> 09:56.850
Let me move this below update.

09:56.850 --> 09:57.420
Okay.

10:00.200 --> 10:01.100
Over here.

10:01.400 --> 10:03.260
So I'm going to make a.

10:03.860 --> 10:05.870
Private void damage.

10:05.870 --> 10:07.550
Maybe we're going to need to make it public.

10:07.550 --> 10:09.800
But let's see when we get in damage.

10:09.800 --> 10:14.240
If game difficulty is equal to normal, we're going to do something.

10:14.240 --> 10:16.040
Then we're going to return from a method.

10:16.430 --> 10:21.440
For example, we're going to deduct fruit from a fruit collected on a game manager.

10:21.440 --> 10:23.900
And I know that variable is public over here.

10:23.900 --> 10:24.860
Fruits collected.

10:24.860 --> 10:27.590
But I did it only so we can see it is working.

10:27.590 --> 10:32.870
Overall it's better to keep it private since we still testing and developing the game.

10:32.870 --> 10:34.160
I'm going to keep it public.

10:35.640 --> 10:40.890
But to get the value or deduct the value, I'm going to make a method because that's a good practice.

10:42.200 --> 10:43.220
To do so.

10:43.220 --> 10:49.040
So over here I'm going to make public void remove route.

10:49.960 --> 10:50.830
And this will do.

10:50.860 --> 10:59.890
Fruits collected minus minus in game UI update fruit UI fruits collected total fruits and I want to

10:59.890 --> 11:06.790
make a public int fruits collected and it's going to return me fruits collected.

11:07.120 --> 11:07.780
Okay.

11:07.780 --> 11:08.860
Very nice.

11:09.220 --> 11:12.280
Now let's go back to player with this method.

11:12.820 --> 11:15.280
Let's go back over here.

11:15.640 --> 11:23.080
And when we get in damage and if game mode is normal we're going to do a game manager remove fruit.

11:23.350 --> 11:26.260
And then we want to check if we have fruits at all.

11:26.290 --> 11:29.170
Because if we don't have fruits we need to restart the game.

11:29.170 --> 11:32.650
So I'm going to do if uh game manager.

11:33.380 --> 11:41.420
Fruits collected is less or equals to zero, then we suppose to restart level.

11:43.000 --> 11:43.810
All right.

11:44.430 --> 11:48.750
And then after all of this, we're going to return.

11:49.290 --> 11:54.930
And then over here we're going to make another if statement if game difficulty equals to.

11:55.890 --> 11:56.580
Hard.

11:57.520 --> 11:58.480
Then we can just.

11:59.760 --> 12:01.410
Restart level.

12:01.800 --> 12:02.640
Just like that.

12:02.640 --> 12:04.080
No need to remove roots.

12:04.110 --> 12:05.400
No need to do anything.

12:05.400 --> 12:06.750
Because this is the hard mode.

12:06.750 --> 12:07.980
You have to be careful.

12:07.980 --> 12:09.630
You cannot get any damage.

12:09.750 --> 12:12.510
Now, when can we call this damage method?

12:13.490 --> 12:18.530
I think we need to call it when we get a knock back, and also when we fallen into a dead zone.

12:19.130 --> 12:20.390
So.

12:21.980 --> 12:23.540
Uh, for the knockback.

12:23.540 --> 12:24.530
It's easy.

12:25.640 --> 12:27.650
Knockback method is here.

12:27.650 --> 12:32.060
So we can just call it here or we can go to damage trigger.

12:34.730 --> 12:36.110
And just call it here.

12:36.720 --> 12:38.820
Right, but we would need to make it public.

12:39.390 --> 12:42.510
But we would know where do we call damage methods?

12:42.510 --> 12:44.280
So I kind of like this idea.

12:45.210 --> 12:47.670
Let's go here and make it public.

12:47.850 --> 12:55.020
So now we have public void damage on a damage trigger over here we can not only call knockback.

12:56.150 --> 13:01.910
And also we can do player damage and we need to go to the.

13:04.080 --> 13:04.890
Uh.

13:04.890 --> 13:05.970
That's all.

13:06.630 --> 13:07.470
Over here.

13:09.870 --> 13:12.780
And coal layer damage.

13:14.000 --> 13:14.900
All righty.

13:15.560 --> 13:16.640
Very nice.

13:16.640 --> 13:23.360
Now we don't want to respawn player if game is hard, so maybe we can just do the check inside of a

13:23.360 --> 13:24.230
game manager.

13:24.230 --> 13:25.910
Yeah, now this is all good.

13:25.910 --> 13:28.700
It's supposed to work, but I don't want to check it now.

13:28.700 --> 13:31.970
I want to set up a level restart and check it all together.

13:31.970 --> 13:33.620
So let's go to Game Manager.

13:37.320 --> 13:38.280
Um.

13:43.360 --> 13:44.080
Over here.

13:44.080 --> 13:46.030
I'm going to make private void.

13:47.930 --> 13:52.610
Load current scene and it will do.

13:52.640 --> 13:53.780
Scene manager.

13:55.250 --> 13:55.880
Load.

13:55.880 --> 13:58.040
Scene of a level.

14:01.890 --> 14:03.870
Last current level index.

14:04.140 --> 14:06.780
And then I want to make a public method.

14:07.670 --> 14:18.800
Public void restart level in which we're going to do UI in game dot instance fade effect.

14:20.680 --> 14:21.280
What's up?

14:22.100 --> 14:22.640
Great effect.

14:22.640 --> 14:23.540
Fade effect.

14:24.050 --> 14:25.610
I forgot, how does it work?

14:26.570 --> 14:32.570
Screen fade, we're going to give target alpha of one duration 1.5 f.

14:32.660 --> 14:36.830
And as a method we're going to pass load current scene.

14:37.890 --> 14:39.540
Sorry it didn't work for some reason.

14:41.040 --> 14:41.610
Load.

14:41.610 --> 14:42.660
Current scene.

14:43.460 --> 14:44.300
Just like that.

14:44.300 --> 14:47.810
So now when we need to restart level, we can call this method.

14:49.510 --> 14:50.530
Very good.

14:50.920 --> 14:55.840
Uh, let's go to the respond method we have for the player.

14:59.520 --> 15:00.900
Where is the respawn?

15:02.950 --> 15:05.410
This game manager became too cluttered.

15:05.440 --> 15:06.640
I want to clean this up.

15:07.860 --> 15:08.340
Yes.

15:08.340 --> 15:09.300
Over here.

15:09.330 --> 15:12.990
Actually, over here I'm going to open curly brackets.

15:14.820 --> 15:18.510
And I'm going to do if difficulty manager.

15:21.020 --> 15:23.000
That the instant naught equals to null.

15:23.600 --> 15:24.410
Then.

15:25.540 --> 15:25.960
I wait.

15:25.960 --> 15:26.350
How?

15:26.500 --> 15:27.820
How do we make it pretty?

15:27.820 --> 15:28.300
This.

15:28.300 --> 15:28.840
How?

15:33.800 --> 15:35.750
Equals to difficulty manager dot instance.

15:35.750 --> 15:38.600
And then if difficulty manager not equals to null.

15:42.550 --> 15:44.560
And difficulty manager.

15:46.310 --> 15:49.520
Difficulty equals to hard.

15:50.780 --> 15:51.500
Then we're gonna.

15:52.350 --> 15:53.250
Return?

15:53.250 --> 15:54.120
Yes.

15:56.810 --> 15:58.250
This is how it's going to be.

15:58.460 --> 16:05.120
Now, all of this supposed to work, we only need to call restart level on the player inside of a damage

16:05.120 --> 16:05.780
method.

16:05.780 --> 16:07.460
So let's go there.

16:09.760 --> 16:11.410
I'm going to do game manager.

16:11.890 --> 16:13.570
Restart level.

16:13.660 --> 16:15.160
And over here.

16:15.760 --> 16:16.540
Game manager.

16:16.540 --> 16:18.280
Restart level.

16:19.070 --> 16:20.000
All righty.

16:20.790 --> 16:21.720
Going to save this.

16:21.720 --> 16:24.000
And finally, this is ready.

16:24.450 --> 16:31.380
Oh, by the way, how it is working right now, if we have one fruit and we get in damage, then we

16:31.380 --> 16:32.430
will restart the level.

16:32.430 --> 16:33.810
That's not what I want.

16:33.810 --> 16:35.430
So let's.

16:37.310 --> 16:38.750
Let's do it like so.

16:38.750 --> 16:40.430
Let's do else.

16:40.940 --> 16:42.110
Remove fruit.

16:42.470 --> 16:43.550
So if you have.

16:44.670 --> 16:46.230
Cero or less, we're going to restart.

16:46.230 --> 16:48.660
Otherwise we're just going to remove fruit and nothing else.

16:48.870 --> 16:49.950
It should be better.

16:50.650 --> 16:51.310
Yeah.

16:51.340 --> 16:53.140
Let's go to unity now.

16:56.500 --> 16:58.150
I'm going to select my difficulty manager.

16:58.150 --> 16:59.560
I'm going to choose normal.

16:59.560 --> 17:00.880
I'm going to go to play mode.

17:05.240 --> 17:07.190
So I have one fruit getting damage.

17:07.190 --> 17:09.410
I lost it getting damage again.

17:10.250 --> 17:12.440
And my character did not die.

17:12.440 --> 17:13.820
But we restart the scene.

17:13.850 --> 17:15.830
Okay, I'm going to see how we can fix it.

17:15.830 --> 17:17.840
Let me try to jump into a bit.

17:20.000 --> 17:21.230
Now there is no dead zone.

17:23.230 --> 17:24.280
That's on.

17:30.730 --> 17:33.160
I know I have to start over.

17:38.030 --> 17:39.560
Jumping into a pit.

17:40.770 --> 17:41.850
Restarting.

17:42.030 --> 17:43.470
Okay, this is good.

17:43.470 --> 17:49.170
The only fix is to kill the player when he's getting damage like that.

17:49.170 --> 17:52.410
I like it now let's fix that problem with the knockback.

17:52.410 --> 17:56.970
So when you get knocked without HP or fruits, you're going to die immediately.

18:00.410 --> 18:01.640
Let's go over here.

18:01.640 --> 18:06.290
I'm going to just call method die here like that and over here as well.

18:06.290 --> 18:06.680
Die.

18:07.250 --> 18:07.730
Yeah.

18:14.330 --> 18:18.230
And over here we call damage before knockback on a damage trigger.

18:18.500 --> 18:19.910
I guess this is important.

18:24.550 --> 18:26.050
Don't forget to do this.

18:29.680 --> 18:30.070
Now.

18:30.070 --> 18:31.090
It should be good.

18:31.150 --> 18:33.760
Let me try to start game in a hard mode.

18:35.250 --> 18:36.180
Hard mode.

18:39.650 --> 18:45.620
Now, even though I have a fruit, I'm going to get damage and died and have to start over.

18:49.260 --> 18:49.980
Okay.

18:50.160 --> 18:52.050
What if I do normal mode?

18:54.100 --> 18:55.270
You've got the fruit.

18:55.420 --> 18:56.740
Got the damage.

18:57.890 --> 18:59.570
And get damage again.

18:59.870 --> 19:01.370
And then you.

19:01.610 --> 19:04.160
So this works very well I like it.

19:04.160 --> 19:08.150
As I said, I'm going to delete difficulty manager from here because we're only going to need it when

19:08.150 --> 19:11.750
we test in the difficulty or when we start the entire game to play.

19:11.750 --> 19:15.170
But when we just test levels, I guess we can test them on the easy mode, right?

19:15.170 --> 19:21.080
Lastly, I think the fade is too long when you die because this is the platformer game and I believe

19:21.080 --> 19:23.240
player would want to start over faster.

19:23.240 --> 19:27.350
So let's just go to game Manager over here.

19:27.950 --> 19:29.060
And.

19:31.480 --> 19:33.970
When we restart the scene.

19:36.600 --> 19:37.380
Over here.

19:37.380 --> 19:42.960
I'm going to do just a 0.75 F, so it's going to be faster.

19:42.990 --> 19:43.830
Okay.

19:43.830 --> 19:46.770
Hey guys, I just realized I forgot to show you something.

19:46.770 --> 19:48.360
Something very nice.

19:48.720 --> 19:51.180
Uh, let's go to the main menu.

19:51.660 --> 19:58.350
And over here I want to display what the difficulty does, like sort of a text over here that would

19:58.350 --> 20:02.850
say, hey, easy mode does this, normal mode does this.

20:02.850 --> 20:05.370
So how is it going to work?

20:05.860 --> 20:07.210
On the object.

20:07.210 --> 20:12.400
You can add on pointer enter or on pointer exit functionality.

20:15.320 --> 20:17.300
And we just need the script here.

20:18.040 --> 20:19.540
Let me go to UI.

20:22.020 --> 20:22.860
Script.

20:23.400 --> 20:26.940
UI difficulty button.

20:27.850 --> 20:30.460
Okay, we're going to open this.

20:31.640 --> 20:34.370
And I'm going to do close all by this.

20:34.880 --> 20:36.800
First we're going to need reference to the text.

20:36.800 --> 20:40.310
So serialize field private text mesh Pro.

20:41.650 --> 20:44.680
Um, difficulty info.

20:44.680 --> 20:51.730
And we need, uh, serialized field, private stream description.

20:51.730 --> 20:52.570
All right.

20:52.570 --> 20:57.160
And we want to turn this string into some sort of text area.

20:57.160 --> 21:01.300
And that's why we can type square brackets and do text area.

21:01.300 --> 21:02.290
Because of that.

21:02.290 --> 21:05.950
Now we'll have an area of attacks, not just one line.

21:05.950 --> 21:07.180
Let's go back.

21:08.750 --> 21:12.140
Let's drag this script on these three buttons.

21:12.710 --> 21:15.770
If you go to button and you can see we have a description here.

21:15.770 --> 21:16.880
Very nice.

21:16.910 --> 21:22.220
Now we need another element here I'm going to make UI Text Mesh Pro.

21:23.030 --> 21:25.040
Let me take this text.

21:25.610 --> 21:26.840
Drag it.

21:27.880 --> 21:31.300
Here, we're going to change it to Minecraft Asdf.

21:33.600 --> 21:35.130
And I'm going to make it.

21:36.320 --> 21:38.060
Look something like this.

21:38.060 --> 21:39.500
I think it should be okay.

21:39.650 --> 21:41.780
Let's align it in the center.

21:42.540 --> 21:44.610
Now let's make font 42.

21:47.190 --> 21:51.570
And then let's select all three buttons and drag this text over here.

21:51.750 --> 21:54.480
I'm going to do description.

21:55.140 --> 21:56.460
Difficulty.

21:56.460 --> 21:57.450
Description.

21:57.450 --> 21:58.410
Nice.

21:58.740 --> 22:03.750
Now what we want to do next we want to go to the script of UI difficulty button.

22:03.750 --> 22:09.120
And over here in this script we just need to type comma pointer enter.

22:09.120 --> 22:13.080
And there is I pointer enter handler.

22:13.080 --> 22:14.490
Let's choose it.

22:14.580 --> 22:18.450
And let's add a pointer exit handler.

22:18.450 --> 22:25.440
So these two methods will be called when pointer enters the area of the game object.

22:25.440 --> 22:29.430
In our case pointer is a mouse and game object is a button.

22:29.430 --> 22:35.730
So every time mouse will enter the area of a button, this method will be called.

22:35.730 --> 22:38.580
And over here we can do difficulty info.

22:38.610 --> 22:40.860
Dot text equals to description.

22:41.370 --> 22:42.630
On pointer exit.

22:42.630 --> 22:44.370
We're going to do difficulty info.

22:44.520 --> 22:48.480
Dot text equals to just empty space like that.

22:48.630 --> 22:49.200
Yeah.

22:49.200 --> 22:52.170
Let's save this and let's go back to unity.

22:55.350 --> 22:57.270
And as his own.

22:58.780 --> 22:59.500
And here I'm going to help.

23:00.660 --> 23:01.890
That's at your house.

23:04.950 --> 23:06.720
The experience and knowledge.

23:08.360 --> 23:11.090
And over here I'm going to type any damage will.

23:12.840 --> 23:13.650
All right.

23:14.040 --> 23:18.750
Now let's go to play mode and we can see if I'm entering a button with my mouse.

23:18.780 --> 23:20.910
We have a description of the difficulty.

23:20.910 --> 23:22.350
Any damage will kill you.

23:23.780 --> 23:25.490
Yellows fruits on damage.

23:26.330 --> 23:27.260
Unlimited life.

23:27.260 --> 23:28.760
You don't lose fruits on damage.

23:28.760 --> 23:32.060
Description could be a little bit better, but that's just an example.

23:32.060 --> 23:34.820
If I come up with a better description, I'll let you know.

23:34.820 --> 23:37.760
Okay, well now that's good.

23:37.760 --> 23:42.920
Let's disable I mean, let's remove text here by default and let's disable it.

23:42.920 --> 23:47.570
Let's enable main menu and we can go to the next video.
