WEBVTT

00:00.080 --> 00:00.840
Re UI.

00:01.000 --> 00:07.040
So what we can simply do, we can move over to our hierarchy than canvas, and we can select the game

00:07.040 --> 00:10.840
over UI, and we can press down Ctrl D to duplicate.

00:10.840 --> 00:17.040
But uh, but if we do this then go over to Inspector Overrides and then click on apply.

00:17.040 --> 00:24.800
All the changes will also be gonna happen our game vector UI, which we really don't want.

00:24.800 --> 00:26.680
So how we can do that.

00:27.040 --> 00:31.200
So in order to do it, we're gonna approach a different way.

00:31.800 --> 00:38.080
Uh, to do that, we will move over to our project app assets and then prefabs folder and let's find

00:38.120 --> 00:39.400
the game Over UI.

00:39.520 --> 00:46.480
So I have it over here inside my prefab folder instead of duplicating underneath our canvas basically

00:46.480 --> 00:51.800
in the hierarchy, we're gonna duplicate in this brief inside this prefabs folder.

00:51.800 --> 00:58.720
So now if we just go over to uh, this game over UI, then go over to Inspector Overrides and then apply

00:58.720 --> 00:59.800
all the changes.

00:59.800 --> 01:02.740
Not gonna be changed change in the our game victory.

01:02.780 --> 01:03.180
Goodbye.

01:03.220 --> 01:04.820
So basically that is the thing.

01:05.100 --> 01:11.460
And that is the reason we're gonna duplicate from, uh, we're gonna duplicate from inside this prefab

01:11.500 --> 01:17.460
folder instead of underneath our, uh, basically underneath our canvas in the hierarchy.

01:17.660 --> 01:23.740
So we're going to select our game over UI from that prefab folder where we turn it into a prefab that

01:23.740 --> 01:24.340
game over.

01:24.380 --> 01:28.940
Anyway, let's select that and let's press down Ctrl D to duplicate.

01:28.940 --> 01:34.340
And we're gonna call this one something like Game victory or let's call it victory Y.

01:34.380 --> 01:36.940
So let's right click on it then rename.

01:37.260 --> 01:42.340
And I'm going to call this one victory UI victory UI.

01:42.700 --> 01:47.780
And now what we're gonna do we're going to select our game over UI in the hierarchy.

01:47.820 --> 01:49.340
Let's go over to Inspector.

01:49.340 --> 01:50.500
And we're going to uncheck.

01:50.500 --> 01:52.260
Basically we're disabling that.

01:52.380 --> 01:55.820
And now what we're going to do we're going to choose our victory way.

01:55.820 --> 02:00.500
And let's drag it over to this canvas top of this canvas GameObject in the hierarchy.

02:01.020 --> 02:03.810
And as soon as we drag it, we can see it now.

02:03.970 --> 02:08.450
And we need to change some, uh, some things right over here.

02:08.450 --> 02:13.930
But before I do, I'm going to select my BG underneath my game over UI game object.

02:13.930 --> 02:18.090
And let's drag it in the center in the Y in the zero.

02:18.330 --> 02:22.970
So instead of saying you lost, we're gonna say something like victory.

02:23.170 --> 02:26.010
So let's change the text inside of it.

02:26.290 --> 02:28.450
So let's click over here header.

02:28.490 --> 02:30.610
Let's go to header then text.

02:30.850 --> 02:34.130
And let's go over to Inspector and Inspector.

02:34.170 --> 02:37.050
Then scroll down to the this text component.

02:37.050 --> 02:40.370
And we're going to say something else instead of you loss.

02:40.370 --> 02:42.450
So we're going to say something like victory.

02:42.770 --> 02:44.610
So let's say victory.

02:44.850 --> 02:46.170
And now this is fine.

02:46.290 --> 02:53.410
So now if we select our parent game object then go over to Inspector Overrides and then apply all the

02:53.410 --> 02:55.930
changes we made inside this vector UI.

02:56.090 --> 02:59.330
Now it's not going to be saved into this game over UI.

02:59.530 --> 03:04.310
So if I open up my game over UI from that folder by double clicking on it.

03:04.350 --> 03:11.670
We cannot see the change right over here, so that's why we just duplicated our game over UI in the,

03:11.790 --> 03:13.510
uh, from that prefab.

03:13.550 --> 03:18.350
Uh, prefab folder, uh, to create our UI.

03:18.430 --> 03:20.070
So basically that is the thing.

03:20.070 --> 03:25.470
So we're going to go back and in order to go back in a hierarchy, you can see the back arrow.

03:25.470 --> 03:27.910
So just click there in order to go back.

03:28.270 --> 03:36.630
And instead of saying retry we're going to say something like uh uh, we can say next, uh load next

03:36.630 --> 03:36.950
level.

03:36.950 --> 03:38.590
Or we can simply say next.

03:38.590 --> 03:40.790
So let's select our retry button.

03:40.790 --> 03:45.990
Let's go over to Inspector, and we're going to change the text inside of this button.

03:46.390 --> 03:50.230
Uh firstly let's rename this button to something like next button.

03:50.590 --> 03:55.590
So let's call it next button and next button.

03:55.590 --> 03:59.190
And we also need to change the text inside of this button.

03:59.190 --> 04:03.330
Instead of saying retry we're going to say something like next.

04:03.330 --> 04:04.770
So let's click over here.

04:04.770 --> 04:07.370
Let's choose the text inside of this button.

04:07.370 --> 04:09.730
Let's go over to Inspector Text Component.

04:09.730 --> 04:12.250
And we're going to say something like next.

04:12.650 --> 04:17.810
And what we can do now we can simply move over to our parent game object.

04:17.810 --> 04:23.810
So in our case vector UI let's go over to Inspector Overrides and then apply all.

04:23.810 --> 04:31.530
So the changes we uh, we made inside this vector UI, it's going to be saved into this vector UI prefab

04:31.570 --> 04:32.370
as well.

04:32.450 --> 04:39.250
But it's not going to change in this game over here by since we just duplicated this victory UI from

04:39.250 --> 04:42.090
that folder from this game over UI.

04:42.130 --> 04:43.970
So basically that is the thing.

04:43.970 --> 04:45.770
So I hope you get the idea.

04:45.970 --> 04:53.170
And now what we need, we need a we need to trigger this vector UI in the Y, as we have done with this

04:53.170 --> 04:54.370
game over UI.

04:54.570 --> 05:01.370
So whenever I'm going to click right mouse button, I just want to bring up the game over UI in the

05:01.410 --> 05:03.080
y axis to be zero.

05:03.480 --> 05:08.160
So firstly what we're going to do we're going to select our victory UAI.

05:08.320 --> 05:11.800
And let's select this BG underneath our victory y.

05:12.000 --> 05:13.960
And let's drag it in the bottom.

05:14.360 --> 05:17.080
And we need to do the scripting of it.

05:17.200 --> 05:21.200
So so to to do that I'm going to select my scene management script.

05:21.200 --> 05:24.160
Let's double click on it in order to open that up.

05:24.640 --> 05:31.720
So as you can see so we need a reference of this BG BG.

05:31.760 --> 05:37.760
Then we can just uh bring this up into uh in the y axis to zero.

05:37.760 --> 05:39.560
So it's going to be center it.

05:39.960 --> 05:43.160
So for that we're going to open up our script.

05:43.160 --> 05:45.760
But before I do I'm going to select my player.

05:45.800 --> 05:52.280
If I go over to Inspector Player uh we can see we have the reference right over here.

05:52.560 --> 05:54.880
So we can do it here instead.

05:54.880 --> 05:56.960
So let's open up our player script.

05:57.080 --> 06:03.860
So what we basically need we need a reference of this BG from this vector factory UI game object, you

06:03.860 --> 06:09.460
can simply say so we need a reference of it, then we can just trigger it.

06:09.460 --> 06:11.300
So let's open up our player script.

06:11.300 --> 06:14.060
So I'm going to select my player GameObject in the hierarchy.

06:14.220 --> 06:16.820
Let's go over to Inspector then Player Script.

06:16.820 --> 06:20.180
And let's double click on it in order to open that up.

06:20.620 --> 06:26.020
And what we will do, we will go to top of our class underneath our UI title.

06:26.180 --> 06:29.940
Let's make a serialized field a serialized field.

06:29.980 --> 06:34.700
Sorry, we're going to make serialized field private.

06:35.060 --> 06:39.460
And that BG itself a basically game object.

06:39.460 --> 06:44.900
So we're going to type this game object and we can call this one something like victory V.

06:45.020 --> 06:50.300
Let's call it uh victory victory BG something like that.

06:50.300 --> 06:52.260
And let's close that up with semicolon.

06:52.260 --> 06:55.380
And we're going to press down Ctrl S to save our script.

06:55.420 --> 06:57.420
And now let's move over to unity.

06:57.900 --> 07:04.680
So underneath our player Skip we will able to see another field just gonna pop up, uh, pop up, and

07:04.680 --> 07:09.960
it's going to say something like victory y as we name it inside our code.

07:10.160 --> 07:16.920
So it's going to pop up underneath our UI title in the inside, our player script in The Inspector.

07:17.080 --> 07:23.000
So just wait a moment and once our compilation is done, we can simply drag the reference.

07:23.000 --> 07:28.960
And if we move over, if we select our player game object in a hierarchy, then go over to Inspector

07:28.960 --> 07:29.840
Player Skip.

07:30.000 --> 07:35.480
Underneath our UI title we can see victory BG and it says non game object.

07:35.560 --> 07:41.200
So what we need to do now we're gonna select our BG not this victory game object.

07:41.240 --> 07:47.080
Basically we're gonna select the BG underneath our victory way and let's drag it over to that field.

07:47.200 --> 07:50.840
Now we can see we have the BG basically this victory BG.

07:51.080 --> 07:52.800
And now we need to trigger it.

07:52.880 --> 08:00.080
So uh, for now we don't have anything like checkpoint or final point to get end of the level and win

08:00.080 --> 08:00.640
the game.

08:00.920 --> 08:04.270
So for now I'm going to test with right mouse button.

08:04.270 --> 08:09.990
Basically, whenever I'm going to click right mouse button, I just want to bring up this factory UI.

08:10.310 --> 08:13.270
And later on we're going to replace that with something else.

08:13.270 --> 08:21.230
Like if we get an end of the level or we just win the game, then we're gonna bring up the victory UI

08:21.270 --> 08:24.070
and we're going to do it later for testing purposes.

08:24.070 --> 08:26.230
I'm gonna do with right mouse button.

08:26.630 --> 08:28.790
So let's open up our player script.

08:29.190 --> 08:35.790
And firstly we need to set the BG local position in the y axis.

08:35.830 --> 08:39.550
You can simply say -1005 hundred.

08:39.590 --> 08:44.550
Like as we have done with this BG basically came over a UI.

08:44.590 --> 08:47.470
So we basically just gonna do the same thing.

08:47.630 --> 08:50.830
So firstly we're going to move over to our start function.

08:50.830 --> 08:55.950
So in this start of the game I just want to set the position of this factory y.

08:56.110 --> 09:04.610
Basically the BG in the bottom, something like -1005 hundred like we have done with this PG so we're

09:04.610 --> 09:05.890
gonna do the same thing.

09:06.170 --> 09:10.610
So firstly we will go to victory BG that we have a reference of it.

09:11.050 --> 09:17.290
Victory BG then we're gonna go to uh we, we're going to access the local position.

09:18.410 --> 09:18.730
Sorry.

09:18.770 --> 09:20.930
Firstly we will go to transform.

09:21.210 --> 09:24.010
Then we're going to access the local position.

09:24.010 --> 09:32.770
And we're going to set equal to new uh vector three which is going to have x axis, comma y axis comma

09:32.810 --> 09:34.130
z axis.

09:34.450 --> 09:36.730
And we're going to close that up with semicolon.

09:36.730 --> 09:40.090
So in the y what we're going to do we're going to set it in the bottom.

09:40.090 --> 09:46.050
So we're going to do it something like -1002 hundred if something like that.

09:46.210 --> 09:48.170
And in the X we don't want.

09:48.170 --> 09:50.770
And also we're going to put zero F in the X.

09:50.770 --> 09:54.930
And we're going to do the same thing in the z axis which is zero f.

09:55.050 --> 09:58.250
Now we just set the position in the start of the game.

09:58.250 --> 10:04.470
So we need to trigger our victory BG to basically bring up in the center in the y axis.

10:04.870 --> 10:08.550
So what we will do for that we're going to make a separate function.

10:08.550 --> 10:10.710
So let's move it in the bottom.

10:10.990 --> 10:22.590
So let's make the function somewhere we can make it anywhere we can uh let's do that.

10:29.230 --> 10:29.670
Okay.

10:29.710 --> 10:34.870
So I'm going to do it somewhere over here over here.

10:34.870 --> 10:38.430
And or we can do it inside I guess.

10:38.430 --> 10:42.270
Player collectible script right over here as well.

10:42.790 --> 10:45.870
Uh, but we're going to do inside our player skip.

10:45.870 --> 10:48.030
So let's make the function here.

10:48.790 --> 10:51.950
And, uh, let's make this function public.

10:52.350 --> 10:54.590
And for function we're going to type void.

10:54.750 --> 11:00.270
And we can call it something like trigger trigger victory.

11:00.750 --> 11:03.700
Trigger victory UI something like that?

11:03.700 --> 11:09.500
Let's make first bracket and some curly brackets and what we want to do inside this function.

11:09.500 --> 11:13.860
We basically want to bring up that BG in the center in the y axis.

11:13.860 --> 11:17.860
Basically we just want want to set the y position to zero.

11:17.860 --> 11:21.420
So it's gonna it's gonna be centered basically.

11:21.420 --> 11:22.660
That is the thing.

11:22.660 --> 11:32.100
So firstly we will go to victory UI BG then we're gonna use this lead move local Y as we already used

11:32.100 --> 11:36.420
for our game over UI as you saw earlier.

11:36.620 --> 11:44.220
So this line move local y, it's gonna take basically it's gonna move our this BG in the y axis.

11:44.220 --> 11:49.340
So first thing it's going to take the position from uh basically where you want to move.

11:49.340 --> 11:51.660
So in the y axis we want to move.

11:51.700 --> 11:54.500
And we're using this little move local y.

11:54.820 --> 12:00.700
Basically it's gonna move our victory a victory in the y axis only.

12:00.940 --> 12:04.080
And as a first argument it's going to take the position.

12:04.080 --> 12:06.640
So we're going to put zero F basically means center it.

12:06.680 --> 12:07.480
It's gonna do.

12:07.680 --> 12:14.000
And the second thing it's going to take the time, uh, to just move our PG to that point.

12:14.000 --> 12:21.200
So we're gonna so we're gonna choose less than a one second, something like 0.8 f, uh, eight f,

12:21.240 --> 12:27.760
and and we can just close that off with semicolon, but we want a little bit animation.

12:27.760 --> 12:33.040
So that's why, uh, closing the brackets we're going to type dot set.

12:33.280 --> 12:38.360
Uh set is set is out back something like that.

12:38.360 --> 12:44.360
And make sure you make this first bracket you can use any uh any like that.

12:44.360 --> 12:46.640
So we getting an error.

12:49.680 --> 12:50.520
Sorry.

12:50.560 --> 12:51.680
Now it's fine.

12:51.680 --> 12:55.240
So you can use any like dot set.

12:56.040 --> 12:58.040
We can use dot set.

12:58.320 --> 13:01.880
Is our, uh, bounce like that?

13:02.000 --> 13:03.600
It's totally up to you.

13:03.710 --> 13:05.430
whatever you want to set.

13:05.430 --> 13:08.110
So I'm going to use this set is out back.

13:08.350 --> 13:11.990
And we're going to make this first bracket because this is a function.

13:11.990 --> 13:14.590
And we're going to close that off with semicolon.

13:14.590 --> 13:17.630
And now we're going to press down Ctrl S to save our skip.

13:17.630 --> 13:19.510
And now let's move over to unity.

13:19.750 --> 13:21.870
But we also need to call this function.

13:21.870 --> 13:25.110
We basically just made the function and we never calling it.

13:25.110 --> 13:30.070
So when I just want to call it once I'm going to click the right mouse button.

13:30.070 --> 13:34.070
Then I'm going to call this trigger victory UI function.

13:34.070 --> 13:35.790
Or we're going to call this function.

13:35.790 --> 13:39.110
And this function is just going to move over to our victory BG.

13:39.350 --> 13:43.470
And it's going to move our BG in the y axis only.

13:43.470 --> 13:46.270
And we just pass zero basically means center it.

13:46.430 --> 13:49.190
And the second thing it just takes the time.

13:49.190 --> 13:56.310
And you can use dot after closing the brackets the animation that you want or or if you don't want any

13:56.310 --> 13:59.230
animation then you can just close that open semicolon.

13:59.230 --> 14:02.190
And that's all since I want animation.

14:02.190 --> 14:07.170
So that's why I just said set is out back and you can use anything like that.

14:07.170 --> 14:09.850
So I'm gonna move over to my update function.

14:09.850 --> 14:13.250
And we do know that this update function runs every single frame.

14:13.250 --> 14:17.130
So over here in the bottom I'm going to check with right mouse button.

14:17.130 --> 14:20.890
And later on we're gonna replace this with something like checkpoint.

14:20.930 --> 14:25.490
Basically if we win the game then we can just trigger our victory UI.

14:25.650 --> 14:28.450
For now I'm going to check with my right mouse button.

14:28.450 --> 14:30.010
So I'm going to use this if condition.

14:30.010 --> 14:32.650
Let's make first bracket and some curly brackets.

14:32.770 --> 14:34.650
And what we want to check over here.

14:34.650 --> 14:41.290
We basically want to check if input dot get mouse button down.

14:41.530 --> 14:43.650
And we need to make these brackets.

14:43.650 --> 14:47.330
And inside this bracket we need to pass 0 or 1.

14:47.330 --> 14:48.370
So we're going to pass one.

14:48.370 --> 14:51.410
One basically means the right mouse button.

14:51.410 --> 14:57.090
So if input dot get mouse button down one basically means if we're clicking the left mouse button,

14:57.090 --> 15:01.690
if that is the case then what we're going to call, we're going to call this trigger victory.

15:02.450 --> 15:09.150
And it's going to do these things right over here as you can as you can notice, basically, we're doing

15:09.150 --> 15:14.750
the same thing as we have done with that game over UI game or game over UI.

15:15.350 --> 15:17.190
Now we're going to call the function here.

15:17.190 --> 15:19.590
So let's call it trigger vector UI.

15:19.790 --> 15:24.030
And let's make first bracket and some and close that up semicolon.

15:24.030 --> 15:26.910
And we're going to press down Ctrl S to save our script.

15:26.910 --> 15:28.870
And now let's move over to unity.

15:29.430 --> 15:30.830
So you will see.

15:33.470 --> 15:38.350
So as soon as we're going to right click the right click our mouse button.

15:38.350 --> 15:42.110
You will see this page is just going to pop up in the y axis.

15:42.110 --> 15:43.990
And it's going to be centered.

15:44.030 --> 15:47.750
Since we pass zero F in the y basically means center.

15:48.390 --> 15:49.550
And we don't.

15:49.550 --> 15:54.110
And we we didn't mess around with the x or z axis.

15:54.110 --> 15:55.630
So it's going to be fine.

15:55.630 --> 15:59.630
So let's click on this play button in the top in order to play our game.

15:59.630 --> 16:01.550
And let's take a look on this.

16:01.830 --> 16:07.780
So as soon as we're going to click the right mouse button, it's going to pop up in the y axis to zero.

16:08.020 --> 16:09.500
So just wait a moment.

16:11.180 --> 16:12.060
So now.

16:14.500 --> 16:19.660
If I right click, as you can see, as soon as we right click it just pop ups.

16:19.900 --> 16:23.460
And if we click on this next button it's doing nothing.

16:23.460 --> 16:27.900
So we're going to we're going to create a next button function for uh sorry.

16:28.140 --> 16:34.900
Uh we're going to create a uh you can simply say a function for this next button.

16:34.900 --> 16:36.180
So let's do that.

16:36.180 --> 16:39.060
And we're going to do inside our scene management script.

16:39.100 --> 16:43.820
Make sure you just click Get Out of play mode by clicking on that play button one more time.

16:44.420 --> 16:47.420
And let's make a function for our next button.

16:47.420 --> 16:50.460
To do so I'm going to open up my scene management script.

16:50.460 --> 16:53.780
So I'm going to select my Scene Management GameObject in the hierarchy.

16:53.820 --> 16:57.020
Let's go over to Inspector, then Scene Management Script.

16:57.020 --> 16:59.940
And let's open that up by double clicking on it.

17:00.300 --> 17:04.380
Uh, so we have the retry level and the menu uh function.

17:04.380 --> 17:10.440
So let's make a one more function for our, uh, next button.

17:10.440 --> 17:15.040
And we're going to make this function public since we're going to call this function through onClick

17:15.320 --> 17:16.040
event.

17:16.040 --> 17:19.640
So let's make a public, uh, void.

17:19.800 --> 17:25.440
And we can call this function something like load next level something like that.

17:25.440 --> 17:30.560
So let's let's call it load next level.

17:30.760 --> 17:33.800
And let's make first bracket and some curly brackets.

17:33.800 --> 17:37.040
So we don't have the next uh level right now.

17:37.320 --> 17:41.400
So if the button is working fine or not we just want to check.

17:41.400 --> 17:47.640
So for that we're going to print out a message uh, in the console, something like, uh, load next

17:47.640 --> 17:50.320
level for testing purposes only.

17:50.520 --> 17:54.840
So we're going to type debug dot log in order to print out our message.

17:54.840 --> 18:03.960
And we're going to say something like in quotation load uh load load next level, something like that.

18:04.380 --> 18:08.980
And let's, uh, let's close that up with semicolon.

18:08.980 --> 18:12.060
And we're going to press down Ctrl s to save our script.

18:12.060 --> 18:14.100
And now let's move over to unity.

18:14.380 --> 18:20.500
So we need to hook that, uh hook that load next level function with our next button.

18:20.820 --> 18:22.820
So we need to select our next button.

18:22.940 --> 18:24.220
Uh, next button.

18:24.220 --> 18:28.940
And we need to, uh, hook that function with our next button.

18:28.940 --> 18:30.260
So just wait a moment.

18:33.260 --> 18:34.580
So now it's done.

18:34.900 --> 18:41.060
Uh, so I'm gonna move over to my hierarchy, then canvas, then victory ui, bg, and we're gonna choose

18:41.060 --> 18:42.260
our next button.

18:42.500 --> 18:47.980
Let's go over to Inspector, then scroll down to the button component and it's going to be something

18:47.980 --> 18:48.660
like this.

18:48.660 --> 18:50.460
So click on this plus icon.

18:50.460 --> 18:55.660
And you need to drag the game object in which game object the script is sitting on.

18:55.660 --> 18:58.900
And we do know we have done inside our scene management.

18:59.180 --> 19:04.500
So basically if I choose my scene Management GameObject in the hierarchy, then go over to Inspector.

19:04.500 --> 19:09.250
We can notice in management script is added to this scene management game object.

19:09.250 --> 19:14.970
So we basically need to select our scene management scene management game object from our hierarchy.

19:15.170 --> 19:19.370
Then drag it over to this right over here on click.

19:19.370 --> 19:22.250
And as you can notice it says no function.

19:22.250 --> 19:24.010
So let's click on it.

19:24.010 --> 19:26.530
And we're going to move over to scene Management script.

19:26.530 --> 19:32.970
Because this scene management inside this scene management game object the script is setting setting

19:33.050 --> 19:35.850
setting which is our scene management script.

19:35.850 --> 19:38.450
So that's why we're going to click on this no function.

19:38.450 --> 19:43.290
And then we're going to move over to scene management script or scene Management C class.

19:43.290 --> 19:48.170
And in there we created as you can notice which is load next level.

19:48.170 --> 19:49.650
So I'm going to choose that function.

19:49.650 --> 19:54.850
Now whenever we're going to click on this next button that load next level function.

19:54.850 --> 19:57.970
Just going to call out and what that function is really doing.

19:57.970 --> 20:00.130
It's basically printing out this message.

20:00.170 --> 20:02.730
So it says load next level.

20:02.730 --> 20:09.270
So now let's move over to unity and let's click on this play button in the top in order to play our

20:09.270 --> 20:09.670
game.

20:09.670 --> 20:11.630
And let's take a look on this.

20:11.630 --> 20:16.750
So as soon as we're going to click on that next button, you will notice the message just going to pop

20:16.790 --> 20:20.910
up underneath our console tab says Load Next Level.

20:21.510 --> 20:26.110
So now if I just right click on it uh it's get pop up.

20:26.110 --> 20:29.510
And if we just go ahead and then click on this next button.

20:29.510 --> 20:35.670
As you can see, as soon as we're clicking on it underneath our console tab a message is getting pop

20:35.710 --> 20:35.870
up.

20:35.870 --> 20:37.870
Says load Next Level.

20:38.190 --> 20:43.110
And if we click on this menu button it's not working at all.

20:43.110 --> 20:49.150
So we need to hook this menu button with our menu function that we created inside our scene management

20:49.150 --> 20:49.710
script.

20:49.710 --> 20:50.990
So we're going to do that.

20:50.990 --> 20:52.710
So let's get out of play mode.

20:52.950 --> 20:54.990
And we're going to choose our menu button.

20:54.990 --> 21:01.270
Let's go over to Inspector then button component in the bottom and a new game object.

21:01.270 --> 21:03.230
So we're going to drag the game object there.

21:03.430 --> 21:08.250
Let's go to no function then scene In manuscript or in scene management.

21:08.250 --> 21:09.170
See shop class.

21:09.370 --> 21:12.810
And we're going to choose this manual function for this menu button.

21:12.810 --> 21:15.450
And make sure you go to Parent Game Object.

21:15.450 --> 21:18.970
And then go over to Inspector Overrides and then apply all.

21:18.970 --> 21:25.930
So the changes you made inside this factory UI, it's going to be saved into this factory UI prefab

21:25.970 --> 21:26.770
as well.

21:27.170 --> 21:31.650
And I'm going to clear my console tab and let's go over to the top.

21:32.170 --> 21:36.970
So let's click on this play button in the top in order to play our game.

21:36.970 --> 21:39.050
And let's have a look on this.

21:39.050 --> 21:43.170
So so by now if we click the lab sorry.

21:43.210 --> 21:48.650
If we click on that menu menu button then menu function just going to call out.

21:48.650 --> 21:52.010
And we don't know what we're doing inside that menu function.

21:52.010 --> 21:54.730
So I'm going to right click first and it's pop up.

21:54.730 --> 22:00.610
And now if we click on this menu button, as you can see as soon as we're clicking on it underneath

22:00.610 --> 22:04.810
our console tab a message screen pop up says Load menu.

22:05.090 --> 22:07.360
So we don't have the scene yet.

22:07.360 --> 22:09.160
We're going to create that later.

22:09.400 --> 22:15.320
And if we click on this next button we can see load next label message just getting pop up.

22:15.400 --> 22:19.600
So instead of printing out message we want to do something else.

22:19.840 --> 22:22.600
So we basically want to load the next table.

22:22.640 --> 22:27.000
And if we click on this menu button then we need to load up the menu scene.

22:27.000 --> 22:29.360
Basically those are the things that we want.

22:29.400 --> 22:34.360
So I hope you get the idea that how you can do it and I'm gonna get out of play mode.

22:34.360 --> 22:40.960
So I hope you get the idea that how you can just make the victory UI, uh, from, uh, from scratch,

22:40.960 --> 22:44.960
basically by duplicating from inside that prefab folder.

22:45.200 --> 22:51.160
So some things we need to duplicate in the hierarchy, but some other things we need to duplicate from

22:51.160 --> 22:58.160
that prefabs folder to make, uh, to maintain our project or to work a little bit faster.

22:58.160 --> 22:59.960
So basically that is the thing.

23:00.200 --> 23:01.880
So I hope you get the idea.

23:01.880 --> 23:07.040
And now we're going to press down Ctrl s on our keyboard in order to save our project.
