 if we change the mode to 5, everything will be 5, 10, 100, max. So now let's test it. We are currently at level 18, so it should be at 23. Hello guys, Cryptograms here. Welcome back to another idle game tutorial video. This is episode 31. And today we're going to be doing different settings for our by max. For example, by five by 10 by 100. And of course by max. So the four settings, we're going to do that all in this video. So make sure you smash that like, keep watching all the way through. Comment your suggestion below if you're new. Make sure you subscribe to my channel to turn on notifications. Anyways, let's go on with it. So we're just going to add a button here to change all of our by maxes accordingly. Upgrade by mode. That's the button name. Now let's hop onto our script. We need to add the setting. So we're going to add a text up here. I'll indicate which by max we're using. So this will be by mode text. And we also need a bull. No, we're using it because it's more than one setting. We could honestly just use something shorter, but I'm just going to use an int. This will be our by mode. Okay. And in here, we're going to do this, we're going to do this, I think we're going to do the by max in here, not in methods. Yeah, because we don't do by max in here, we have our separate ones right here. So we're just going to do it in here. So we're going to create a method called change by mode. And it's going to be a switch statement. And it'll have our current. I don't know why it's been so laggy today. Like writer is just being really dumb today. I don't know why. But so by default, it'll be zero. So we're going to switch just to one. So let's see, that's going to be max. There's going to be four different modes. We're just going to return it. Actually, no, we need to change the UI because we're only going to change the UI on start and then when we change the actual setting one, two, two, three, three, zero. So now this will loop from zero to three back. Okay. So now we need to have our UI. So we have our by mode text. Okay, so we're going to set this. Oh, yeah, we can just do this inside the, the switch. So one zero will be max. So by default, actually by default be by max, this one will be then we have max at the end, we have 100. So we're going to do these each inside our by max productions ones that we have right here. Okay. So in here, we need to check if by mode is equal to zero, because this is the by max. If so, we will run this. I see we're going to move this to the outside. Okay. And we're going to move this back to the outside. Okay. And okay, hold on, I see what we should do. Okay, so we're going to make a var n right here equals zero. Okay, so basically if the by mode is equal to zero, we're going to set it to this by max right here. This is a big double. Okay. And also we can do switch case in here too. Okay. So for by max, n will equal this. And we will just break out of that. Okay, so now n will equal to five. Remember, this is the amount of upgrades we can buy. So we're just changing the cost accordingly to how many we want to buy. Okay. Next episode, I'm going to do OCD buy. Okay. So I kind of want it to be its own thing. And by mode three will be 100, just like that. And then we just change it accordingly. Cool. So now what's copy and paste this for our other production. We have n equals zero. That looks good. Save that. So basically it switches between Oh, except the only issue is that we don't want to change by mode every time we actually have that. That's not good. And also this is flopped zero case zero should be that everything should be shifted down by one. Okay, so zero should be the by max one should be five two should be 10 three should be 100 you can add as many as you like, you can add 25, you just have to add a new case in between and just shift the numbers to whatever you want. So that should work and it'll only buy if we can afford that. Right. We need to change our text. Because right now we have our by max count right here. So what we're going to do is go to our our count right here. We're going to copy the same thing right here. Okay. Except we need our big double and right here. And get rid of this. Okay, so now it will just replace this and honestly, we can just return 100 in here. Or yeah, we'll just do that. Return five and return this right here. And just in case for some reason, none of these are it, we just return zero. Okay, we can get rid of these breaks because they are redundant. And we will just copy the same thing for the production by max and honestly, we can merge these two together. We've already done that in the methods right here, just like that. We've already merged them. Copy and paste that. Okay, we can save it. It should be good to go. Cool. All right. So now we got to drag our text to here into the by mode. Save it. And let's run it. Also, we've we also have to in our by in our by mode upgrade button, or just our button, we have to apply change by mode. Save that again, just in case for some reason, the game or unity freezes. Cool. So now if we go to upgrades, right now it's on by max, we change the mode to five, everything will be five, 10, 100 max. So now let's test it. We are currently a level 18, so she'll be at 23. Yes, like that. So now if we keep buying, let's see how many more we buy. Okay, let's do 100. CHP 36 now. Yep, cool. Let's do 10. So it should only be able to buy this three times. 123. Yeah, so now it won't buy anymore after that. So next episode, we're going to do OCD by where automatically rounds up to the next five, because people love that. If you have that in your game, people will freaking love you. Okay, because everyone loves the OCD, everyone hates having to go to this exact number, I got to go back and make sure it's exactly correct. Nobody likes that. So yeah, because he like, people like the nice numbers, people just love that. So anyways, I'll show you that next video, turn on notifications so you can get notified for that. If you enjoyed this video, smash a like, leave your comments below, subscribe to my channel and check out my other videos. Anyways, thank you for watching. Have a good one. Peace.