 Hello guys crypticons here welcome back to another unity C sharp idle game tutorial video this episode 37.5 Yeah, 37.5. So why 37.5? Well, thank you to Florian for commenting this but Each time you launch the game you can claim the next day rewards may be caused by UTC time in the data save and UTC time string Yeah, so that's a bug that I forgot to check I should have checked for that so my for my My apology for that. All right, so we're gonna fix that in this video So if you enjoy this make sure you smash that like button subscribe my channel if you're new and check out my other Videos in the top right corner and comment your suggestions down below. All right, let's get on with it So I kind of already started working on this but there's a few things I'm gonna have to do so Let's see what's the code before Okay, so let's undo everything here Okay, so here. This is where we were we were we left off here So we're gonna get rid of some of this print stuff because we don't need it anymore Okay, so we can get rid of this UTC timer and So what we're gonna do what we're gonna do is call this store Our stuff this start co-routine at the start as well because we want to load in that time and We're gonna move this if statements Um in here the reason why is because this this start co-routine is being called and When we get to this yield return right here the code continues here But it stops in here and that causes some problems because we're basically checking for this if statement here And by default this temp date time is Set to this right here one one and year one Sorry about that, but this is an issue because these two are not equal obviously and this will trigger the The date time to work now. I should have just checked each year like if The next day is greater than instead of Are they not equal to but this is okay? in fact, well because I mean this is also an issue because Let's say we compare June 26 in July 1st, right if we do greater than you know, that's not gonna work for the date But for the month it will so that just causes some issues So we just need to make sure this doesn't happen And we do that by grabbing this if statement and throwing it into the at the end of this Co-routine and we're gonna make a variable a temp variable called data equal game dot data Okay, so now again, this basically compares the day the two days The last saved or the last time we claimed our reward and our current time And if it's true and we haven't claimed yet, then we can set that to ready and we're gonna show our daily reward So that should work And I think there was something else that I did too. Oh Yeah, okay, so let's save that There was one thing I forgot to do and it was the reward claim text I forgot to drag it in here and This not doing this cause of no reference error So make sure you drag your reward text from the daily reward claimed pop up into the reward claim text Okay, let's save it and it should work like a charm Okay, so see I've already claimed today. Obviously. I was testing the glitch here and yeah You can see how Can't claim the next day Yep, we've already claimed these five days Okay, and I think another thing I forgot to do is to actually reset these days. So let's do that real quick So let's go to our claim here. So we increment it every day, right? So let's just say Okay, so we're gonna check to see if this is ready, right? So if it's ready and At the end of here Okay, so if we don't want to reset this after reclaim the seventh time, right? Or else it'll look kind of funny, right? Because when you complete like a weekly thing here, let me see let me find it in this one game Can you even see it in here? All right here. Okay, so for example, you're probably hard to see maybe It's trying to focus Okay Let's see. Is it gonna focus? Maybe eventually. I don't know, but you can see how there's like a daily reward thing here This is also called idle golf tycoon really good game really good idle game. I recommend it So you see how there's like these check marks here after I get this special reward It's gonna stay there until the next day, right? It resets Okay, because this is next reward there. I know it's hard to see it's very blurry. This is the piece of crap camera But yeah, that's what I meant Okay, so what we do here is we calculate each current day. So let's say we claim the first day. It's gonna be one Okay, the second time two three four five six for the seventh time. It's gonna go from six to seven Okay, so now we're gonna calculate if Okay, so if data that current day is Greater than or equal than seven and we're gonna reset that back to zero Okay, and now the next time we can claim it it should reset So let's save that and I think we should be good. I want to see if I can reset the timer I really doubt it because I want to be able to test this Okay, so Let's see here. I doubt I'll be able to Yeah, so our current day is six and we've claimed day five So once we can claim tomorrow this work meant to six and then seven and then it'll reset Okay, and I promise this should work It should reset. Okay, so it's the same thing This is cool. Okay, so since this is greater than seven then one next day is ready We should be able to increment this and say can we actually change this? I'm curious. I really doubt it. Yeah, there's no oh You see oh Will this do anything? I doubt it. Oh, no, that's just the this is from the This is from Here That's what this date time is. Okay, so it should work and oh Okay, all right. Thank you guys for watching. I know it's a really short video I'll have something good cooking up on Monday morning If you enjoyed this video make sure you smash that like button Even every single like means a lot to me subscribe to my channel You're new check out my patreon and the delete in the just in the lab the links in the description below I am still two patrons away today from the into my dimension series And I also want to get a quick shout out to Jeremy airy for the $100 super chat today. Thank you very much. He is a game developer as well much much much much exponentially much better than me of course and he is part of a company called ridiculous gaming and Yeah, thank you very much. I'm still kind of surprised that happened and yeah I'm glad it did but shout out to him big shout out to him. It was a huge motivation. Anyways, all that aside Thank you guys for watching stay tuned for another video subscribe Remember turn those notifications if you don't have them on right now. Okay, I can tell I'm watching. I'm watching right now You better turn it on by now Have you Good good. See you guys in the next video