Hello guys.
Welcome to the video.
In this one we're going to set up the settings UI.
We don't have much of a settings in the game, but still I would like to show you how to maybe control
volume of sound effects and background music.
And if you want you can add more settings here later on.
So we already have a setting UI and a back button.
So this is good.
Let me double check.
Does it return to main menu.
Yes okay.
Now we need to.
Make two elements.
This is my reference how it's going to look.
So we're going to make something like this.
This is from my previous project and I think it's a good one.
Let's make UI slider.
And I'm going to give it a parent of empty Game object.
And it's going to be something like BGM volume.
All right.
So the BGM volume itself can be something like.
This may be.
And slider.
I think I want to make it with 1000 height 100.
Very good.
Here is the value of the slider.
And if you want to get parameter from the slider.
You can just get component of the slider and then ask for value and that would work.
Uh, actually slider is working right now.
You can go to play mode and you can drag it here and there.
It works very well.
But before we do anything else, I want to make this slider pretty.
Let's go to Graphics enemies.
Plant.
And over here.
Or the handle in the image.
I want to drag a bullet.
And let's click set native size.
So now it's pretty nice.
And we can see it looks like a bullet.
Isn't it cool.
Now we probably need to go here and do a stretch in the center.
Yeah.
Like that.
This works very well for me and I think of making it a bit bigger.
Or maybe we can make the slider slimmer.
Yeah, that would be better.
Let's take the background and let's.
Make it slimmer.
So maybe.
Well, let me see.
Ten from the top, ten from the bottom.
Yeah.
And fill area itself over here can be slimmer as well.
So then from the top, then from the bottom.
Yeah.
Nice.
This looks good to me.
Now let's, uh, create an image under BGM volume.
Image is going to be plant image.
We're going to go and find the idle sprite and just drag it here like that.
Let's click Set Native Size.
It's going to be a bit bigger.
And I think we can place it here.
And it's going to look like plant is shooting this um handle of a slider.
Yeah, I think it's a cool idea.
I like it pretty much.
Um.
Maybe we can make him smaller.
Let me see.
Yeah, point 75 should be good.
Okay, let's place it like that and we can see it's better to give it some sort of a platform.
So I'm going to go to graphics terrain.
Terrain sliced.
There is this, uh.
Piece of platform somewhere here.
Yeah.
This one.
So we need to make.
An empty object platform.
Then we need to make UI image.
And drag this to this field like that.
I'm going to click Set Native size.
I'm going to duplicate it.
Drag the middle of the platform.
Then I'm going to duplicate it and drag the third part of the platform.
Very well.
Now let's take this image.
Drag it to the left.
And we can see position should be -100 in my case.
This one has position over zero and the third one has position of a hundred and the x.
So this makes a platform.
And now I can take this platform and place it below the flower.
Like that.
Isn't it cool?
I think it's very cool.
Let me see if we should make it smaller.
Maybe 0.75 will work.
Good.
Okay, now let's take care of the handle.
Uh, handle.
No fill area and a background.
So for the field area, we can choose some color.
From the flower.
Um, yeah, there is a color picker.
Just pick it and choose the color.
Okay, I think maybe this is good.
I think it's okay.
Let me try something else.
Yeah, like it like that.
Now I'm going to copy the color.
Go to the background, paste the color in here.
And then I'm going to make it brighter from what we have.
Something like.
This.
Yes.
So now this shows the difference between field area and not field area.
Okay I like it.
The last step would be to add a text here to explain the player what it does.
So I'm going to make UI Text Mesh Pro.
Uh, slider.
Sorry.
This will be background music.
Are we going to change font to Minecraft?
And this one should be stretched, I believe, to something like that.
Yeah, I think it's good.
Let's just, uh, do alignment in the center, and let's take the element and place it over here.
Okay.
Looks good to me.
Now we have a BGM slider and it's very cool.
I'm going to just press Ctrl D to duplicate it.
Move it up.
And then on this one it's going to be suffix, volume or sound effects.
The text will say.
Sound effects.
And the plant over here can be flipped.
So I'm going to do rotation on the Y 180.
I'm going to place him over here on the left.
Nice, nice nice nice.
Maybe we can animate.
These two elements would be cool.
What do you think?
Let's try that.
Let's go to animation.
We have main menu here I'm going to make.
Uh, animator controller settings.
Plant, I don't know, I don't have a better name.
And let's put an underscore here okay.
Now we're going to drag this on the image.
Over here and over here and all.
What we left to do is go to animator.
Let's find animations, enemies, plant idle.
Let's just drag it here.
It will be animation by default.
And now when we go to play mode.
We have pretty settings with oh wait, animation is not lame.
Why not brother?
Come on, play the animation.
Okay, I'm not sure what's up with this one, but what I'll do here is I'll go to I'll go to main menu
and I'll make an animation here for this animator.
Let's select this plant image animation.
Oh, sprites are missing.
Interest in.
Why could that be?
Game object or component is missing.
Okay.
Uh, maybe because we use sprite renderer, and here we have an image, and that's why it's like that.
So what we're going to do here is go to the numerator delete this.
We're going to make a new clip animations.
Main menu I'm going to do a plant plant idle UI.
You're going to go to Graphics of Enemy.
Uh, plant.
Let's take the idle sprites.
Drag them here.
Sample rate 20.
And this should be good now.
Because this one will be by default and it's supposed to work, I believe.
Let's see.
Yeah.
Works very well, I like it.
If you want, you can make it smaller.
If you want, you can trigger the shoot animation when you click on the slider.
But that will be later.
As of now, this is all good.
Uh, the back button works.
Let me see.
Yes.
Okay.
This is very nice.
Now let's disable this.
Let's go to main menu and enable this.
And we're going to duplicate new game.
I'm going to move it down and I'm going to right here.
Settings.
Settings button.
Better be yes.
And this one new game button.
And this is continue button.
And this one will say settings.
Okay.
Also, I feel like it's not in the middle, but I'm going to take care of that later.
This one should be good.
I'm going to take these two buttons, move them down a little bit.
Yeah.
All right.
Now let's move continue above settings below and over here on the settings we want to go to button,
and we want to ask it to switch to settings UI.
All right now let's double check this and we're going to go to next video.
Yeah it works very well I love it.
Okay let's go to the next video.
We're going to do something with the like entire UI.
We're going to make it work properly.
We're going to set relationship between buttons and then check everything.
I'll see you there.