Unity Game Tutorial: Memory 2D | Octo Man | Skillshare
Play Speed
  • 0.5x
  • 1x (Normal)
  • 1.25x
  • 1.5x
  • 2x
9 Lessons (3h 45m)
    • 1. #1 Introduction

    • 2. #2 The Cards

    • 3. #3 The Game Layout

    • 4. #4 The Card Manager 1

    • 5. #5 The Card Manager 2

    • 6. #6 The Score Manager

    • 7. #7 The Particle Effect

    • 8. #8 Using The Particles

    • 9. #9 Additional Hide Matching Cards

  • --
  • Beginner level
  • Intermediate level
  • Advanced level
  • All levels
  • Beg/Int level
  • Int/Adv level

Community Generated

The level is determined by a majority opinion of students who have reviewed this class. The teacher's recommendation is shown until at least 5 student responses are collected.





About This Class

In this Unity Video Course you will learn how to create your own Memory Game or Matching Game using the Unity Game Engine & Inkscape for the Grafics. For the functionality we write C# Code in Monodevelop.


  • You will learn the basics how you can create the cards on your own using Inkscape. You can also use any other software.


  • You will learn to create a new 2D Project in Unity and setup everything needed

  • I will show you how you can setup the playfield and organize it using the Canvas System which requires Unity 4.6+


  • We will put in functionality with scripts using Monodevelop and C# (you can also use Visual Studio)

  • Also we implement a Timer, Score, Turns and a Combo System for more User Experience


As a result of this course you should be able to create your own level with different sizes and cards for your Memory Game.

In the end of this course you will have a fully functional Memory 2D Game.

So what are you waiting for?

Let's make your dream game a reality!!

Level: Beginner
Video Course Length: ~3 hours
Unity Version required: 4.6+

Meet Your Teacher

Teacher Profile Image

Octo Man

Let's make your dream game a reality!!


Class Ratings

Expectations Met?
  • Exceeded!
  • Yes
  • Somewhat
  • Not really
Reviews Archive

In October 2018, we updated our review system to improve the way we collect feedback. Below are the reviews written before that update.

Your creative journey starts here.

  • Unlimited access to every class
  • Supportive online creative community
  • Learn offline with Skillshare’s app

Why Join Skillshare?

Take award-winning Skillshare Original Classes

Each class has short lessons, hands-on projects

Your membership supports Skillshare teachers

Learn From Anywhere

Take classes on the go with the Skillshare app. Stream or download to watch on the plane, the subway, or wherever you learn best.



1. #1 Introduction: Hey, guys, My name is Dr Man and this is introduction video for my upcoming tutorials. Serious about how to grade a memory or matching game in unity 5.6 in this case. But actually, this is also possible to create in older versions off this one. So what we're gonna go into is you want to create some cards and inks game, so you might want to make sure that you're gonna get this one. You can also create the cards and all the setups in our Photoshopped gimble, whatever you please, Nike, the game is actually the get matching game you may remember on notice on no, from your childhood eso. When you're opening one off those carts in here and another one, you're gonna have to remember all off those matches. And once you find something which is matching each other, let's see if we can get anything in here that will disappear. Or actually, in this case, there will be some particles coming out of it and they gonna stay opened on the field again . We are able to later on going to delete those from the field if we like to, and once we have completed the war. Game off course we go, um, start or actually would stop the time we're going to see the score on. And we have an integrated combo system. How many turns we took, and we're gonna be able to restart this and all the cards will be automatically. Um yeah, re matching, actually. So when we are whips, next time I just go over and press this one. So when we're clicking and here you can see those cards have been changed once again. So when we are restarting the game all off that stuff, it's going to restart as well. Okay, that was a lucky turn in this case, and you're gonna see the coma system is going to grow up and will also be the multiplier for the score in the tool case. So what would go do is actually we just create to us re scripts which are not too hard to explain. Hopefully And to understand, of course, as well. We want to go and create some manager systems for the score and the cart manager itself. Um and we're going to use the canvas system for all the cards. I'm going to demonstrate all of that off course in the territorial serious as well. And yeah, let's create some matching game for you, for your care for your family or whoever you like, and please. 2. #2 The Cards: Hey, guys, my name is optimum in and this is part one off my memory or matching game tutorial. Serious. I'm we gonna crew to start to create the carts. I'm in escape. If you like to create those in gimp or photo sample any other, um, yeah, graphics program or even back toe programs like Illustrator, You have film? Yeah, you're free to do so. I want to keep it as simple as possible and but as well as inform eight if it's possible. So I'm going to using escapes into three and everyone can use it and nobody has to take care of anything. At least I I want to show you all the tools we're going to using here and what you are able to use and later on, how to refine things if you like to. And you can even go in and copy and paste stuff inside of that as well. Like when you go to Google Social. Some three pictures like for doxa cute kitties on whatever you are able to implement those as well I'm going to just demonstrate everything how to create some forms or the basic shapes. Answer on how you can design your card in the background are actually the backside of the card. And also the front sides off the card we are going to use, um, in our game. Well, actually, we want to go and use. You can also don't load a fully or even scan If you like Teoh a fully a car tech like with the 789 cents until kings and queens and tone support, it's up to you on the same about the size we can you make those on crew ERM a quart. But we can also use a rectangle on this case so we can use the regular cart in this particular case or even just co ops. Um, where all the fights were, all sides are actually the same lengths. So let's start. Was that it for us? So what we're gonna take is the rectangular tool were able to drag in a rectangle in any case. So if you want to use, um, regular play cards like maybe this one, maybe they are a bit like this. You just need to notice later on how big they are and we're gonna implement those sizes. I'm entire inside the layout group we're going to use in the canvas later on. At that point, what I want to do is I want to make a regular quite shape. In this case, I hold down at the control key. So I am able to just, um, to snap the sites when I go vertical or actual Diagne Oh, in this case, I'm able to snap that all the lengths in the top and in the right left and so on, of course, are about the same on this one is not needed. So I'm to get this one rounded. There's a little dot in here, or a little point where you're actually able to change the radius on the sites. So if you're happy with the result, of course free and use that on your needs once again, you have to select the rectangular to on the court to, in this case, to make those once again active or inactive, you want to change the scale. You're always able to do so and even the color as well as you have seen in the introduction video and use some blue colors tins. In this case of bluish greenish style, you can design it to however you want. You can't even go and evil and create some I don't know skulls. If you like to our skeletons or anything you prefer even flames fire, whatever your backside off the card or even tribals, if you like to. This is actually not too hard. Teoh get to create. But before we go, do so we want to make sure that we're gonna copy this part in here buying Kolding gun control key and suggest pressing the and scale the 2nd 1 a bit down, you can use the shift key and at the same time, that control can you, So it will be automatically quarter? Uh, yeah, 1/4 as well. So it will be automatically from the center point with the shifty. The control key will make sure that all the sites are going to stay the same lengths. So now you're able to design the world card. You can even say this one is going to be lit up a bit more. Um, and so on and so forth. So design wise, you are free to do everything you like. You can again add in any tribals, any shape, any forms was a busy and lying tool. I'm going to show you some things that you can use. For example, you can use a busy curve to on this case and can create a heart, as you have seen, Um, in the introduction video as well. Actually, I hope so. Um, what do you need is just pretty much this one and this. You have this kind of shape and make sure that the point and the lower point actually at the boat the same center upon center line since we're gonna go in and just to flip them horizontally later on don't. Now, you take this point and holding down the control key, um is the wrong one. And the shift key? I mean, you're gonna select those to you can always go in. And I believe you can do that as well. I only want to do is you want to select this tour so they will be getting symmetrical. Layout it so you have automatically almost automatically a full heart or half full heart side. In this case, I continue this one once again. Maybe in Rhett. When you're holding down the shift key and you go in the bottom left of that little cross. You're gonna get rid off the outline. Okay, so now we have the first half side, actually have done from the heart. So we can actually duplicate this one and make a horizontal, um, shifting, actually. And holding down shift and using the arrow keys on my keyboard or without shift as well We're able, Teoh, move the part directly from the left to the right and with the risen, while holding down the control key and dragging to the right, we are able to drank until we almost hit the corner pieces in the bottom and top. No one would not want to do the one toe. Put them together into one piece. In this case, we're going to go to pass and say combined. Now we have a combined pass, as you can see. But there might be some weird things in here. There might be a double buoyant. For you are a double note in this case, or whatever they are called or not. And those a double does not as well. So we want to get rid off. This one just deleted Onda. There might be another one. We might want to sink off or actually test around actually there to want to make sure that we're gonna put those two together with this point in here. If there If you're not able to do that, you might want to see if there's any other problem in this case. Let's see. Okay. So as you can see those two knots, um, yeah, they should be combined. I'm gonna flip those out and try to combine them once again. And now there are only one piece in this case. So what do you have now is a fully hard if you don't like hard, you can always go in and create anything, um, as you please, like as a 20 before what you want to make sure nexus, you're gonna select from the outside to the inside. All off those, by holding down the shift key and go to the, um, to the to this tool on the right where you are able, Teoh set them in the same horizontal and vertical assignment in this case. So everything is centered. Insolence of force. Um, if you are unhappy with the outline in this case, you can always go in and create some more interesting stuff in this case by maybe just couldn't creating some, um, some tinted parts. And here, like for SOCO In this case, you can always lay this one over. Maybe like this, you can see you will automatically create some interesting shapes in this part. You can always go in and create them small and maybe duplicate this worn and create another one. Maybe here, though it's a more interesting shape in this particular case. Um, and you can create this and be creative as much as you like. Of course, you can always go and you create some more border stuff in here lying. You can old line those. If you like Teoh, you can also go on duplicate those, make them a bit smaller. I want you gonna get again is another interesting shape. Maybe where you're able, Teoh pick and yeah, split those par stuff around. You can even go in and create some sherry's or share reforms. If you like Teoh, I believe we're gonna go and create some carts with some strawberries and stuff. Um, so this is going to be the backside off our cart now again, If you have trouble with the colors or anything else. Of course, you're free to play around with all the color palette and stuff. If something is too big or too dark or too small, whatever you're not Whatever, you know, like I believe 10 those a bit darker looks of it actually a bit nicer. I believe you can always go in and creates cards again to your police and to your to your needs in this case. So depending on the seem you're currently playing on or the country your cards are going to be on, um, you can always go in and design everything to your needs. I'm just go over the basics in here again. You can always go in and also copy and paste all off those, um, little effects on the on the sides. And here just duplicate them arms, flip them horizontally over and user shift key and the arrow keys, um, to make them ah, walk to the other side of it actually could also vertical. We split those to bring them down a bit. If it's too much, you can always use the arrow keys once again and make sure you gonna duplicate them. once again shift them over horizontally once again and bring them somewhere wherever the layout. Yes. Okay, so enough for the backside off the current. We can always go in duplicate the lower part, which is actually just outlined off the card. And we can design this one as well. I've recommend using white or a bit darker sh a bit lightened of gray. I'm or even any other cousin are color off course. I'm gonna docking this one a bit. So I concede. But one better in the video. What I want to show you in this case is, um, how you can design the cards as well. So as we were speaking about Cherries and strawberries and all the other stuff, we actually, you know, I actually go and take those two points, and we can scale those apple holding dawn actually the control key and bring them wherever we want. And this is again. This will be just some basic shapes. In this case, we're gonna use the busy co two, or in this case, and I create some easy shape to make sure that this one is looking like a cherry. Um, if you don't see anything you can always go in and start wherever you please like um, but what was that one? Um, for example, you're gonna choose any point where you want to start. Then you are able to do some fixed lining like this one. Or you can also go in and already designed the shapes by holding down on the point so you're able to already make them be their curse. Okay, so what? I take ISS Actually, I just hold on the control key and select those Not I want to have a bit around it up again , but don't do that while ah, you're dragging or trying to drag around pieces. If you hadn't, happy was a result. Of course, you can always go in and hit control Z to make everything back. Um, and I believe you're gonna have to create or I, in this case, have to create another point in the center off this nine and then this line. So I'm gonna select those and say I want to split those up and press the plus button on here and take this one bit down. Same for those just is the plus button in the top left and make sure that I am dragging those a bit out. And those points, I want to have them also rounded up. So now what we gonna have is just an empty shape. In this case, I'm gonna take any greenish colored so it will represent our sherry again if you are unhappy with the result, Um, feel free to change everything to your needs. Make sure everything fits your design. Um, and all the other thing. So what we're gonna have now is a rather simple cherry on. We can always go in and refined that once again with other busy curve shapes. I'm so, for example, if you want to dart in the lower side or lighten up the upper side, we're always able to do so. For example, you can just create a triangular kind of shaping Here, make those two points in the center just symmetrical, and then fill the color baby darkish and hold down shift. And may I get rid, um, off the lower part in here, that border in this case. So in this case, you can actually go in and create some interesting interesting shapes. Highlight some things that you like to on the Cherries directly, um, and make them look more interesting again. You can always go in and do it however you please. And like, I don't go over do that right now. I just wanted to make sure that you're able to know what I am about what I mean. So again, we want to create some more fruits of pretty quick in this tutorial part. So we're gonna duplicate the card base in this case, hold on control of the shift key once again and use the arrow keys to pass this one directly over to the right on. Maybe. Let's create another shape off any strawberry. So again, it's nothing fancy or more harder to do than creating a heart or something. Maybe there's some more in depth information we might want to take care off, but actually, that's nothing else. I'm not sure why this stuff is coming all over the world time. Um, maybe it's this one. I don't know. However, I want to make sure that all off those are belief. So are symmetrical shapes. So it's I wrote. It's a bit softer in this case. Gonna jack around a bit the corners in here. And if you are, if you don't know how a strobe or bury looks, um, just go to Google and see if you find Tom. Okay, so we're gonna attempt this one once again, we're gonna get rid off the outline, and I want to make sure that I have some green parts in the upper part in here. And some, um, one, um, one thing on the top. So, for example, those you can always again As I told you before, you can always drank around that busy curse to your needs, and they will be rounded up or automatically. Um, again, it may be easier for you to create on the outlines at first. Like this. Make sure you have enough space on rat. It might be too hard to see the outlines while drinking around, So you might want to tend, um, your outlines or actually the strawberry first and another color so you can see those lines which currently, actually, you're drawing around, Um, better wire dragging around. Okay, so let's assume this are going to be our leaves. Gonna get rid off the outlines. Not looking too nice. Gonna dreck around some pieces here and there. So, um, they have looking bit more nicely again. I don't go over the design that's up to you. How you want to do that? In your things on your game and all the other stuff as well. And I want to make some of those points again rounded up like this one. This one, This again. Hold on, Control. I will automatically make those parts rounded up. Um, and we're gonna do that until we are happy with the result. Or actually about to be happy was a result. Ana do that pretty quick in here as well. Okay, so we have now some leave kinds again. We can always go and create shadows for this one on. The easiest possibility would be just duplicate this one. Um, make a little off sent and maybe doctor this one up. And, of course, make sure that we bring this one down One, um, one layer in this case. So what? You can see it automatically create some kind of shadow. Um, your again. And it was a result. You can always go into the shape and fit all of that outlines you don't need on. Bring them just in, um, again, I go and get rid off the gray one. Since I don't need that, I want to have a part in here looking in the top. So what I can do again is using the busy it curve tool using the in apartment and the outer part. Basically, that's everything for that shape I had to sign. Gonna do that a bit light, No up. I'm just with basic colors in here for the moment. Um and of course, I want to make sure that some off the pieces are rounded up once again, so we don't need to take care of those. If you're unhappy, you can always drac around the handles, um, or even get rid off those if you like, um, at any time. But that, like green, is not too nice. And they believe I go with that color and go to my Phil and bring the color is a bit down. Sounds been darkened up in this case. Okay, so now we have a strawberry. This thing is, we might want to take you off that the strawberry isno to present of, um I don't know why I still I have trouble with my mouth, and he s so I wanted Make sure that the size off the strawberry is about the same. Um, if you don't know if that is in the center, you zoom out and see how this is actually looking. And again, if you're happy with the result, Um, yeah, you can do so and create more and more and more. Okay, so let's go ahead and create to Morrison's. I believe that should be at least enough for now. You can always go in and create more and more shapes. More, more fruits. More, more. Whatever. Um, what we create now is maybe a the site was fruit or something. Um, maybe, like, I don't know, this that, um if you have stopped somewhere, you can always take the last point and keep called in your drawing from that mumbling if you're going to bake. No problem. No, it is. You're always able to go back. So I'm hiding this one once again. And of course, instead, off the center points, I believe I bring those. I bring this center point, and at first I don't know why this is still keep popping up here. Um I don't know what we want to make sure in this case, once again, as you want to round up on those arts and here, holding down shift is also doing the same. Ah, that's not looking too nice with that semi symmetrical piece. So I go and use the control key for this. Ah, I thought it might look a bit better. Okay. So again, if there's anything you don't like, dreck around the pieces make the handles, shorten them if they are not askew like we're gonna do and duplicate this one and flips this one over horizontally once again and bring this one together, Um, off course, Keep, um, combined those in the center point or about their If there are more than enough points you needs, of course, make sure that you bring them all together to just one point. Same for the lower important here, select amore. And, um, you bring them together. Ah, Senses is not looking too nice now Gonna shrink this one bit down that see if the size is about the same. And of course, we can always go in and rotate, um, that peace. And here once again, um, this is just the basics. You can always go in and add more details. Okay, So want the last one? Maybe we're going uncle with a melon or a Mm. What else are a an apple? It's also possible. Oh, yeah. Let's create an apple. Pretty quick, though. Never was nothing else than a strawberry in this case on a duplicate that one pretty quick . Um, the only thing is that apple shape in the very pop in here is going to be a bit different. And in this bought him as well. Um, so maybe we're gonna bring those down. Um, And this, like, here and maybe this, Like, like here? Um, yeah, that's close. Maybe like this one. And we can put again the green stuff like, um the the wooden, the wooden part, the top, maybe a leaf and on the bottom stuff as well. Um, and we can take this one to any needs. Once again, we can make this 1 may be a bit of all range Orbit of green. Um, actually, it doesn't really matter. All right, Dr Shred One. Okay, so once again, we're gonna create pretty quick the parts and the bottom and here. So maybe it iss something like that. Just nothing fancy can be green or brown again. Make everything to your needs. And as you like it, this will be just a small detail. So you might not need to go in and push this one too far on once again. If you don't like this, one can always put in one more. Um, and direct this one over and make this one, um, roundish like this I'm going to take on create the upper part, or actually, we're gonna be able to take this one. Gonna duplicate groups, lubricate and direct this one down here. We need to make sure that we make this one of its smaller. Um, So we actually can drac all the pieces toe bit more to the center that, um, that strength on the handles a at least of it, um, and make them work for all. Ample. Maybe. Like that. Once again, you can always go in and to bring more shape and stuff in here. We can always go in and create a little leaf. No, maybe like this on Bring those shapes together. Meggett Green maybe more like this one. So it's lightened up. Get rid off that hope line. And of course, we don't control and shape the leaf where you like it to be rounders on their particular sports. And that's pretty much it for our little apple. Maybe we are able Teoh. Rotate those a bit so they looks maybe be better on we shorten things a bit down. So we're gonna take the upper part from here and bring this one. It needs to be done. I believe that's looking a bit better. And it's not too long in this case. Okay, so Well, now we have carte set up done, I would say again, you can always go and create more more cards. The more cart sets later on you, half the easier it is, or actually the harder it can be to play the game. And, of course, the players are not. Um, yeah, they might not be too confused and also might not be, too, um to be bored to, actually, when there's only four types of cartons case which the players are able to Seoul as like the puzzles. So for the exporting part, actually, you can go in and use the the PNG export, which is over here. Um, I also have this one here on the right side. What, you want to make sure that the Wall page or actually the wall painting in this case is going to be selected? If you're not sure, you can also go and, um, only export everything which is selected so you can use selection in this case, but make sure that everything is selected. Of course, you can always go in and export this one directly in the unity for them as a PNG file, which will have automatically transparent background off course. Make sure that the cards have at least a little bit space in between. So they're not interfering later on with cards. Um, in this case, So what you can do is you can just go in, um, again, choose the past to export this one on ones at the past, and you have named this one correctly. Um, I got gonna do that pretty quick and names this one fruit cards. Um, you you can always go in and renames to whatever you please. And then when once you are happy with with ah settings in this case and the size off. The picture is big enough so the quality stays in place. Actually, you can always go in and export this one later on. Make sure you're safe, this one as as V G five as well. So you're able to go back and export this one bigger. If you need Teoh or you can they don't also go in and at more counts. Um, if you need more, actually. So I hit export right now, and that's pretty much it. And once you are in your unity for the U Able Teoh, go to that particular folder in this case gonna direct this one pretty quick over in here. Um, and I go to my computer user private. That's where the past Where, actually, I just have this one. I have my proof fruit cards and I can instantly go in and passes one into my unity object in my unity assets cannot create a new scene just for you. What do you want to make sure is maybe that you create textures full or something else. I have something already created in here. Um, so that will be actually the next step in the next video where we are going to import all of that stuff. I gonna clear up everything. You actually creating your arm, a new scene and a new project for this tutorial. Serious? We're after, um And after that, Um, yeah, we're gonna start to create the coding and all the other things in this little tutorial serious about the memory game. 3. #3 The Game Layout: Hey, guys, My name is up demand, and this is part two off my memory game tutorial. Serious? I'm in the last part. We were creating some little currents or a card set we are able to use in our project. Um, and what we're gonna do is we're gonna create a razz on you completely new project. In this case, I'm gonna use the same folder as I have my memory game and just rename this one too. Maybe a matching game. So the project is called matching game instead of memory, and I want to make sure that this is the duties set up. Actually, it's it. I don't want to make use off street de, even if you might sing. Ah, this could be 23 d as well. Well, actually, you can also create this one industry he's seen but is not important in this particular case. Um, and also no need it. Um, so I don't need the unity and and analytics in this case. Um, and anything else should be good to go. Um, I believe that pretty much I will everything I want to do and I create the project right now and we should be in a to D set up in a moment if we are not were able to go back into the settings and changes one back as well. And all the newly created scenes will be to D. So the unity is actually, yeah, creating all the engines and deal elves and stuff for us on for the new project and then were able to go in and start create our cart matching gang. So we want to do at first is we want to create two more fooled us in our assets folder. If you have another set up like this one or actually the wall set up is different to yours . Um, yeah, make sure you use it however you please like, um, what we want to do is, at first I want to make sure that the consul is not directly next to the game of you in this case, like maybe this one. Otherwise, you might miss some important information to console are going to tell you. So make sure the consul's always, um, extra next to the game field in this case, so you can always see when there's something happening like a narrow or anything else or any warnings and stuff or even a non referenced and so on your able to, um, go into the consul and see everything instantly. So I believe that's an important one for you. If you're new to unity, other people may already know that. And you can always dreck around that stuff as we have seen to get rid off badly on So you're not after. So what we want to do is we want to create a full of pretty quick, and the 1st 1 is going to be a lot of scripts will ever always groups In this case, I believe three or four is the maximum we are going to need for this one, um, going to land in. And of course, we want to create a texture. It's water or, if you prefer using the name sprites, and you can always go in and use the names brights. I'm named my and Textures. Actually, the naming convention is just for you, but not important for the system. So what we want to do is essence. We have created in the last part our our fruit carts set up on P and G file. We want to direct this one into the Texas water. So I go and do that pretty quick so I can see that on the fly. How it is going to work. So what, you can see it automatically created a sprite to do you. I was a Sprite mode single. Since we have bookable cards on this one, we want to make sure that we're gonna change the Sprite mode to multiple and go and enter the Sprite editor when this is asking you to apply the changes. Since we have changed us, want to multiple, We're gonna want to apply the changes. Of course to this. So now we have to set up in here gonna zoom out a video. Actually, it doesn't really matter. What want to do is want to slice all of that. So I go to slice automatic slicing and all the cards like the card back and so on card back can be done in here and we can rename those at the bottom right as well. Same for the other cards. You are able to name those even if you don't need Teoh sense, a unity will take care of the rest for us. Gonna apply the changes on the top, right? And close off everything in here. So what we have now is in Texas for the when we Clem born actually open this sprite up on that little arrow P can see we're gonna have all the cards already. Yeah, split it up to our needs of the card back and the fruit carts. 123 And for with all our fruits, we had just painted again in the last video. So actually, we don't need to take care of anything at the moment on that on the sprite settings. At this point, we want to create a new system, and you are actually, at first canvass where we want to pass in all the currents and how we where we actually can react to them. So we go to the high rocky panel, right click you. I canvas. So in that Kansas continues rather big in this case, we can create more and more stuff to actually design the playing field on our own, we can implement more graphics. And of course, we can actually make sure that we create our play feels so. And depending on the playfield signs were able to put in more or less cards and designed the game around the point symbol. What I want to do is I want to create another you I, um Well, not a u I, but doesn't empty one also just create an empty game object and as it concedes, automatically size toe 100 by 100. We can use a contract size fitted for this later on, but I believe that's not too cool. Cynthia Woo. Yeah, well, you create a weird things we don't want to go in, So select the camels once again and make sure that we're gonna go in the canvas scale of part of the of the U. S. Scale moat from constant pickle size to scale with screen size. And you can off course Goto's reverend reference solution. You are after so 16 by nine or even Ah yeah, full HD or whatever. Six of 9 60 by 10 0 even for by Serevi like Jos and the campus is going to fit the size. Depending on that values on, we're gonna currently would just want to match a waste for that. So this game off, they're going to be renamed to Space a game object. If you have seen any older versions, aural, the video's off myself spaces are I use space or object actually to space stuff in between or actually hold different informations or different buttons, for example. So what I want to space it to be is, I want to have the space to be my, um, my grit, actually, where all the cards are going to land in so again, depending on the game field you're using. If you have seen the introduction, I had a timer in the year the opponent turn. It's a restart button. It's on. I want to space it toe. Hold all my cards, um, which I want to use in the game. Currently, we're gonna have eight cards in total. Since we have four carts are car. I have four cards I can play. Was the maximum card amount on the playing field is going to be eight on depending on this , the game is not going to be too hard, since you're always able to do implement more and more consequent make this one harder. And so this eight by our four by four field or maybe an for by are no. In this case of four by two field in this case, um or maybe a I don't know any other possible way to show the cards is going to be implemented in this, that the space in this case is going to hold layout group. I want to have all of them in a grit. So I call a or implement a great player group was the cell size of 100 by 100. So every time I create something new and this one will automatically have of the size of one home by 100 depending on the spacing we're going to use in between those we're gonna need to increase or decrease the size of the Playfield once again, this is going to be an eight by to play for four by to play field. Um, maybe we are able to do and is indifferent. But, um, no, not nothing, which would actually look good. However, with that playfield we gonna create you are button. So this button, as you can see, it's automatically. It's ultimately the sized to 100 by 100 which you can also see directly on the button itself and its great out tents. The size the height of ways in this case is driven directly by the grid local. We just create it. So know what we can do. Is there directly inside the great player group? We can resize those buttons if we like to. So we can maybe say I gather that you, the game want to have four cards only in the from the left of the right, in two cards from the top of the bottom, so we might want to increase the size off the buttons. You can always go in and make some small essence when you have more cuts later on on the field, maybe 16. Then you would have a play field off, maybe eight by um, too, or something, or even other parts like four by four insolence was ever seen divided by divide a bull by 16. Um, and you can always go into rearrange all of that stuff. So it's with that button. We want to make sure that we get rid off the text element in here so we just go and delete this one with the dead icky and now we just have the white button. Until we have our own sprites for the back side off the cart, we can actually go to the US bright and it's right image. Uh oh. In this image component. And here we can change that to our card back. What you can also see it automatically cuts off everything which is transparent. And you can also see this one director in the game pit as well. And what? We also have a clickable buttons so we can use the on click advance directly on the buttons or all our buttons. Now, let's create four more on so we can see our space is actually matching the playfield we want to create. If you want to have easy games, you also can create stuff like that. And now you can see the grid are lococo actually, spaces not fitting Well, so we're gonna have to increase the spaces size at least a bit. So we gonna have our play food by four to form by two. Um, if you want to have spacing in between as I said before, maybe like by 55 and the X and the y axis, we need to implement or increase the size is even more for our space. A game object. Once again, you can place that stuff wherever you please. Like the space or later on will automatically filled us. Ah, by those carts. So we want to make sure that those cards are correctly set it up and the space is correctly set it up as well from the beginning. So, um, we don't have any problems later on, and, as you can see are the number for the West should be 615 in my case. And I believe 305 in the height told the space as fitting completely the correct size off the grid. Leo Group was the correct set up. They don't want again. If you have higher or lower amounts of cards, you can always go in and fit to space or and the settled size in the correct layers group to fit your needs. Um, by that. So again, I got a place this war, and I don't know, maybe here and you can also go in a place an image component directly, Anna under it. Make sure that your stretches one or is only and vertically. Where's uniforms? Stretch? Uh, no, that's not cool. Not working in this case. Eso We need to find another way they own for this one. I believe we're gonna do that directly into the canvas and 50 you. I image directly and snapped that toe. The outline points off the spaces. So what we can do with that is, actually we can tend the background off the space object in this case. Same for another image. In this case, we can go in and make this one uniforms stretch, beholding them old and shift, um, and directors one up as well. And we can take this one as well to any color. We please like maybe maybe something like that, so you can tend the backgrounds directly on did use those, um, to make your playfield maybe more interesting for the players. And you can always go in and add more sprites and more objects. More stuff to design the fuel to to your please. And like, Okay. So we can also go in and create the tax elements. Pretty quicks, which we are going to use for the timer. The the combo system. The turns were after and all the other things. So we can data on directly access them from any point we want. Um, or actually, we set them up like that, like we want in this case. And we need to change some things later on to the camera as well, since particle systems are not directly usable or visible in front of the backside of the canvas. Eso we need to take care of this one later on. But for now, we're gonna good do the important stuff, so we don't care about the space any more for the moment when we want to create some text elements in this game is once again. So maybe we go and use a dark black color at first and want to make sure that we go and use best fit in this case on the player can see this one better. We can also, um, write some stuff inside as well, at the point. Like, for example, the time, time or whatever, I have changed my No, it's my people. Naoki. Second there we go. So we can implement any text at the moment. We're gonna automatically feel that stuff later on as well you could always go in and duplicate this once again, this little text field. And of course, don't forget to rename this one. So it's a time or text which will be later on important for us. Uh, so we have the time of text. Now we direct this one. Maybe don't and 1/2 a score text. You can always again go into do whatever you like. Set this one however you like, and wherever house bigger size should be and even, um and even the forint is up to you. How you want to design this one? So we have the time attacks the score text No one who also want to do is implement a combo text combo. And also, don't forget to rename the text field as well Comma taxed. And the last one is going to be or actually too warm or in this case, are the combo, um isn't really set up about. I dedicate this one what we want to have it turns so turns. I want to make sure that the turret is going to be in the center alignment and since the one under this one will be centered to this one as well. So I just passes one over. Maybe here, I can always go in and change the size of the text once again. Or use best fit by just reducing the size off Theo the height off the text element. But I duplicate the combo attacks once again. Or in this case, it turns thanks to make. This 1 may be bigger like this and just enter maybe any random number. So this one is going to be big, bigger. You can always go in and increase the maximum size for the best fit to 50 or whatever. You police, Nike once again, Um, when this is going to be over one How are 99 this case off course, It will automatically fit size to it. Or you leave some space to the left into the right. So the number size in this case will not change one's. It is going to be over 99 this case. Okay, so this is going to be our turns text, and the 1st 1 in year is just a just turns. So it is not so important for us. It's and so we don't need to excess the turn to this case. We just need toe xs the turns text. Since you want to change that, depending on how many clicks have bean or actually tries to open up our field? Okay. And the last one actually is We want to have a new button in the bottom left on which is not inside the space off course which we want to be. Our restart button, though. And just call this one restart. But this was later on. Just have an easy on click event on its so nothing fancy at all. Don't forget to change the colors on the bottom for the text as well. Use best fit if you like to, so the player can see is one better and precise it to your needs. And then we have set up the play field for the moment. Very cool. You can also go unused turns to score or anything double directly over the playfield, depending on the design. Once again, you have changed or yet chosen. But we want to do is we want to create our first script on and in this case, the script for our cart. So I created Sea shell script. I'm just call this one cart. So And what I want to make sure is that in the space of the first button in this case, I want to make sure that I put this card. I'm script directly on the button. You might want to need to go down very, very low and here and try to get this one anyhow onto the button. Um, as against you know, I have added this one in here. Um, I'm not 1% sure sometimes or offset stuff is a bit strange. So what we have in here is we have a M. It's component with the bottom Carbone opponent where we can actually use on click even for ah, flipping the card over once we are clicking on that button. And we can also animate this code wise if we like to what we also need as a second skin rescript is later on a card manager. So, um and we also I want to create a little extra folder and here for all our pre fabs, So just cause on prefects will us. So when I later on go and duplicate the button we currently have, um you can also go in and rename this one, Teoh, maybe cart. It doesn't really matter. What do you name it? You can actually put this as a prefect directly into the prefects for that, like this one. And if we do later on any changes toe one particular card. And we already have copies off that card directly inside that, um, inside the game. Actually, then we can, um yeah. Just changed the stuff, directing the precept off all the cards and all the cards will actually follow up. Where's or the changes, if there are any? Yeah, And if there are any Ah, specific. Once, I believe we're gonna need to tag our current as well. So what we're gonna do is we go to the tack on the top, right? And add a new tack. We'll click on the plus and we just causes one cart. And when I go and click, that's when once again, I want to make sure that a tag it s card and make sure that I apply the changes to the prefab. Also, you can do that, Director. In the prefab Andi, I put the car tech directly on the prefab and all the cards in the scene will follow and get the same tack. In this case, the tax will be later on needed. I believe so are by going through the whole scene and see where the cards currently are. Um, not sure if we need them to, but at the moment, just let's do it. Um, just to make sure we're gonna have this one. Okay, so let's open up the card. Pre father, conscript and yeah, let's start coding and model develop or a visual studio if you prefer this one. Okay, so a cot script is open. I'm gonna zoom in a bit so you can see stuff better. The 1st 1 is we want to make use off the name space unity engine dot You I Because we want to have access to the image component and the button component directly on the card. Also, what is a card about a cart needs, um actually, three main things. Um, which are the Carter bones and the 1st 1 is going to be a public into i d. This idea is representing the number which the car gets while gets shuffled, actually. And depending on the shuffle idea, we're gonna match those two ideas later on in the card manager to compare those ideas. So at least two cards have the same idea so we can compare them and then take them out of the game. Um, what they are, what they will have as well is, um, a public sprite. I'm not sure if this needs with public, but let's do it's Brian. Yeah, we're gonna do that on die cause one the card back. So the card back is always going to be the carpet you gonna decide later on. An export is another one. Because, um, it is also types, right in this case. And this is going to be the count front, actually, where our fruit symbols are on, or any symbols or any kittens Creatures? I don't know. Whatever you are after or even, um, yeah, any symbols on our card. The next one is private one, and there's going to be That's where we need the unity and the doctor. Why name space for IHS the image itself. So it's off type image, and we just cause one image. We need that to change the sprite later on and the same for the button directly. We can pass over everything of directly using the bottom. So it's off. Tight button was a big being, recalls one. Just bottom was a small B. So all of that it will be just needed later on to pass in the data to the button or excess it to make it interactive, ble or not interact herbal. Same for the image components. So we can actually pass in the correct sprites at the correct time. Okay, so for animation, we're gonna need several real more bowling's and stuff on an amount and a speed for the flipping speed and so on, so forth. But I believe we're gonna do that a bit later on. Don't forget to safe in between. Otherwise, you might get trouble. Um, um, sometimes it can be actually a terrible some when model developed does not do anything you like on, and it's not. Do you want to set our image? Teoh Get component. And of course, we want to get the component off the image directly on the bottom. We're gonna be on the same for the button as well. Type of. So image equals, get component image. And of course, it wanted with same again to the buttons going to equal to get component mostly, and the very top off type of button. And, of course, open close parentheses and local line was a semi colon. So we in initialized automatically that this particular image is a component we currently have on this particular cart. Don't forget to safe once again. And let's turn back to unity for a second when we're now going to the prefects. Fuller were able to put in some data already inside the card. We don't want to touch the carp front. Well, basically, we could buy code hide this one in the inspector. Same for the I. D. Like, I only want to make sure that the card is actually the one we want to set the card back. And the card back is actually the card back. We already choose. And here. So once we have chosen this one and hear all the pre fabs as again see are following up, they all have the same card back. Even if they are already inside of that, they don't care about the image we currently have on this. It could be even blank. It doesn't really matter for that particular part. But to set this one up correctly, we just need to do that like this. Okay, So speaking off, hiding stuff in the inspector is actually just an ankle brackets or square brackets in front, off whatever we want to hide on, we just how have that space and he and so hiding in Inspector, we don't need to, but we have the possibility to do so. Um, I believe we're gonna do that for the i d. As well. So actually we get can get rid off stuff in the inspector with the ah us Set up people, for example. You don't want to take care off. Or actually, you want to have people to excess this one, um, again, maybe we're gonna hide those things a bit later on, since we need to make sure that our code is correctly working. So I make a little commanding out in here, and the car in front actually does not. Yeah. Doesn't care what we don't need to take off this one at the moment. Okay, So what? We want to do it versus we want to create our own on click event or own click function. When we're clicking on this, we want to do some stuff. That stuff is actually we want to talk to the tor onto the CART manager and we want to flip the car over to see actually, the cop front. We already got maybe from the system. And since it is working hand in hand with the card manager, we might want to go in and and just you do the basics for this one and hoping back to the card manager in the next video. So we're gonna keep everything organized. So for now, I just commend this one. Our This is our flip open cart lip. Oh, that's a on lake to flip card open or something like that. So, um, is going to be off. It's going to be a public function. I believe so. Since we need to have access directly on the on click events, can excesses one. The other possibility would be, ah, using on or actually passed over and at listener to the bottom. Ones being just are in the start, so we actually wouldn't need to take care of this. And the function could actually be also private. Um, no, matter what the possibilities are a lot. And I just named this one flip cart as the function name. We don't need Teoh implement anything in that. So, for now, let's do some little commanding out. So at first we want to check the first choice off, Or if this is the first choice we gonna have in our CART manager and then we'll want to react to the card manager and want to make sure that we're gonna set all the corresponding stuff, depending on the image and on the button. I'm so this but a car is not flip a bill once again. And also, it's choosing one already in the card manages itself. Um and we want to do that. Um, when we are actually in the CART manager, I believe we're gonna skip that here for a moment, since there is a lot of stuff to do. But, um, yeah, we're gonna We're gonna type or create the Cartman Jeff first in the next video. I believe, um, and flip all over the cards or create the carpenter the next video. Then we go over to the flipping. So for a bit commanding out at this particular point. I want to make some more in force for me and for you later on as well. So at first we want to have a call on click event to flip the cards open. Then what we want to do is we want Teoh create an animation off the cart. So when we're flipping this one open, um, open the card over time and we gonna set the time later on. Live it so fast. We were also able Teoh. Yeah, you had do it visa versa. And actually, if it's a fast we can slow down the speed later on. Then we want to have a functionality. Teoh, A closer card. Andi Later on, directly from the card manager. I just already, um yeah, explained. And it will also want to have that on. We want to close the current over time with an other function, actually which is doing nothing else. Then just doing everything, be the versa, then opened the card. It's nothing fancy at all, but needs to have some little timing and stuff. I will go over that, of course, in the next video, so you'll be prepared for this one 4. #4 The Card Manager 1: Hey, guys, My name is Dr Man and this is Pops three off my every game tutorial. Serious in the last serious. We were actually creating the complete lay out where our cars are going to be on. But we also want to make sure this time is that we're going to create the card manager I was just talking about in the last video. So there's basically nothing fancy at all Well, rez along script, but is needed to get all the cards into the game when we are starting it. Also making sure that everything going to get shuffled in between those carts and yet make use off the card. So actually, when we're going to click something, the card menu will notice when we have clicked that and in return, we gonna compare if, ah, that it is actually the second click in this case. We want to compare if those Carter going to match in this case, we're going to create a new app game object and I just call this one card manager so the car manager actually will hold all the media needed informations like the spacer and all the other things that we actually have the possibility to fill the space that was currents . The rest is going to be driven again by is a great little group and the currents when we're clicking on those will report to the card manager. Hey, I was going, I got clicked, Um, and yet make sure that he company in. So in our scripts, what are we going to create a new script in this case, off type C sharp and is going to be card manager as well. It's a name. I want to make sure that once a compiler is completely down with creating the script and all the stuff, we're gonna direct this card manager on our card manager object. Also, we're going to create a card manager prefect, so any change later on directly in the card manager off course, will represent it into every car manager in the scene. We only want to make sure that there's only one card manager completely in the world scene . So let's open up the cart managers script. Andi, let's get started into I'm creating all the Let's say important things. We need the car to manager to know, um, for example, he needs to know about the prefab off the buttons, off the cards in this case on and all of that stuff needs to be driven by that. So but beforehand we want to make sure that we have the possibility laid on to use images and buttons it directly. In this case, I believe you only use our Maybe we don't. We might want to use unity Internal Do I at the name space later on. So let's make the card managers first static. That means we just need to call the instance off the cart manager later on from the every copy gonna click and pass over the data from the card like the I D. And we are able to store them in the CART manager and clear off the parents and all the other things when they match and do whatever we need to do. So at first. Yeah, let's make this one stating. So be saying public static. Something's lacking. Sorry, the public static, it's of timecard manager and want to create Justin. Instance. So instance, in this case is just the name for the instance off the cart manager, So we are able to call the card manager at any time before hand off started, we're going to create an awake function. So this awake function is going to take care off. Um, that the instance is going to be set before anything else is going to happen in the game. Actually, so awake is always going to be called before start. So make sure you're gonna pass all of that stuff into awake. So and what I want to say in the wake is actually just instance is going to be equal to this. So it makes sure that the current instant off the card manager is going to be this particular cart manager instance. So again, you need to make sure that there's only one instance off the card manager object or even script in the complete game scene. So that's what you need to take care off. If you are not able to take care off anything like that, then you are able to write the singleton design pattern by it. Actually, we don't need toe since we are able to take care of all of that stuff, OK, that's everything for the awake functions, and we're gonna shrink this bit down on we need some. Yet in foes, the first info is for the cards itself. What we want to do is we want to make sure that we're able to remember the choices were going to get from the cards. So in this case, it's going to be a public hint off. I'm gonna name this May be toying is one. We don't need to set anything because it's later on driven by the system itself. And we could do at the same line say it sent it off at the same time that we want to have the choice to as well. So if you don't like the car kind off how you want to write stuff, Actually, you can also go in and create another extra line in this case. So you don't, um, initialized all the ends of the same line that the soldier of two possibilities in this case you can also play around once again, was headers later on. So this duke choices later on actually be hidden in the inspector as well as I explained in the last video, also on the cards directly. So we are able to use the hide Inspector. Um, I don't know how it is called in the front off. Anything you don't want to see in the inspector later on, when you're a bomb. Yeah, When you're starting to set up the world game, actually, or one specific Yeah. Game seen in this case. Um okay, so we have done this one static. What we now need is a list where all our sprites are in for our possible card matches. In this case, all the cop fronts so we can create a new list. Off type was bright. Strike does not need Ah, unity. And in, don't you I and I just call this one's right list. You can also America it I cartoonist or whatever you name it. Um, It is a list off types, right? Of course. And open close parentheses in the same line of business and my colon after. So any list or any sprite we're gonna have or the cock fronts like the strawberry, the cherry, whatever we else have created is going to land into that. So we always have a list of all stripes possibly use that used or possibly be able to used , um from the game itself or from the engine we or the system we're currently writing in here . Also, we are able to count those and see if there's a possibility toe overdo it in this case. And we can actually claim this one by the lengths off the Sprite list. So we're not able to do more cuts than we actually have in this bright list, and so on. Also, we are able to country all of that stuff later on as well. When I was want to do is, since we will need some stuff hidden, um, behind the scenes, actually, we want to go and create those later on a mixing or actually make them pop a private. Or we can serialize those beforehand to make sure that we're able to see that, um, later on in the manager. So we are able to see if everything is working as we want to. So the next list we're creating is of type gain objects, since all the buttons or actually anything in the game, um, is going to be used some kind of game object and a button as well. Well, since the button itself is just a component on the game object, so What we want to have is actually a botanist. You can also name it CART list. If you prefer this one, it's off type. Of course. Knew this type game object open close parentheses. Close the line was the sum of calling once again. If you want to make sure that we are able to see the listener 1% of the directly works with with that list we can also say is going to be a serialized field. So we actually protect this one by private, but still make it visible was a serialized field. And from off it on the next list is actually another one. It's going to be a ah, let's name it hidden button list. Because this is actually a the hidden list which is not interfering with that button. This this is just the button is we need to inter or actually, we gonna clear off when we are shuffling the board, Um, and taking all off the already created buttons, all of it, or actually all of them with some actually set it up i ds and the hidden button. This is actually the storing all the buttons currently in the game and will be later on. Also taken care off when all the choices have been yet done. Then we gonna start to clear off the hidden button this as well. Um, you're gonna looks results lists later on, and we'll see what's happening to those. Of course. Um, and we're gonna later on go and get rid off the serialized field once again. Since we don't need them directly in the inspector again. This is just for testing around if there's any of the only problem problems or something like that. Okay, so what? I also want to do a since I want to flip cards and later on back, I need to hold the choosen cards in another list. Actually, you can also go in and use, um I believe in the ray, but it's not so easy to clear. And so on also, it's not dynamic. That's why I'm using list in here. This, of course, as well off type game object. Since we're not just storing all the choose and carts which are later on, just the game objects in the scene. We're gonna pass those over once we click on any particular count. So this list later on knows. Okay, Those specific cards have been clicked already, and we're gonna take those back on and flip them back if we don't have any match. Otherwise, we're gonna just clear off that list, and we're gonna take the next match. And may I pay a pass or the data directly inside of that? The next one is what we can do, but we don't need Toe is a private interview quips. And this integers going toe. Just remember the last match. And in this case, the last match I d. Okay, so let's just name it Ideal s match. I d m. So that last match ideas basically just taken the first choice of the second Tory's when there is a choice. And when there waas a match complete match. So choice one enjoys two are the same integer in this case. So all our number one or two Israel, whatever. Ah, but not zero. And, um, this is going to remember this, and we're gonna use that later on to compare or actually react to the game in this case. Okay, then we have a public bull. Maybe we're gonna get rid off the public one later on this bull or bull in is if we have chosen something or not. This is later on. Used by, um some, let's say, um yes, some I enumerators in this case. So we gonna be able to block. Um, if there has been a choose already, then we want Don't want to make sure that or we want to make sure that our numerator is not running twice at the same card at the same step in this case. So this is public bore. Um, actually does not need to be a public one. In this case, it needs to be private, but again, we're gonna use that. Uhm basically, to make sure that we are able to control it, we can also make a point of this one Private and Cyril Isis field in this case once again if we need Teoh. Same for the last match, i d. But in this case, I don't believe we need that. So we're gonna serialize the field later on as well, and we're able to see the stuff in the inspector when we need toe. Um then we have a pair. I'm gonna leave a space in between sent someone to later on create some headers. Eso It's easier to understand what you actually haven't here, So, uh, the next one is a public in pairs. Um, so that is actually, um, a number we can import. How many pairs were gonna we want to play as a player? So you want to play one parent? Of course we are able to do so. We also have the possibly two sets, 1 to 16. If this is matching to Sprite this length or count in this case, Um, so this is something you can input any time. And actually, the layout group will Yeah, try to wreck to it. In this case, we might go later on inside at the grid layout group and, um, makes match stuff or actually resize it if we have more pairs in the future s so we can actually resize the grid layouts group element in this case. And we're gonna be able tow put in all the buttons in a bigger or smaller scale, depending on whatever is going to be in. Okay, So, um and of course, what is actually making sands in this case. So what we can do is we can create a header was open. Close the triangle on Oh, the square brackets in here We can just name this one header on. Actually, it's a type header on and in Ah, parentheses. And in in quotes we can say Ah, something like how many? Ah, Paris. You want to play or something like that? So this is something you need to input before you actually saves a scene in this case for your game, for example. So you can say, OK, this is maybe the easy version and year, and you can set this one fixed by whatever value you like. Um, so anything in? But ah yeah, any saying in between all the sprite lists, count actually would match otherwise later on, we go in and protect the parents depending on this, right, let's maybe, or something like that. So we're not interfering this bright lists length in this case. Okay, so at the next born is we need the cop prefab. Since we want to instant, she ate this one and we need this one to be public as well. So it's ah, time game object. In this case, it is just our card cards. Prefab So in this case, just our button in this case, um Ah, Lots of typos, E. So the card prefab. So we can actually set this one up as well. Also, we can create a header in this case, so we know we need to import something in this little field cards. Prefab burden. Okay, so this needs to be in the next part in here, and we can do that for everything. We can choose any head of for everything except directly over the numbers. There are some problems with that, but we don't. You make use of any Denham in this case. Okay? The next one is we need to spacer. We just created in the second. No. Yes, in the second part. Um, where all our cards are going to lend in once they are insane. She hated, and we need to type transform for this one since, um, we don't need the the game object itself in this case. So this is the space or so we can also create ahead in this case, for example, Um, just to make sure that we're going to remember what needs to be inside off that space game on that space a transform slot. In this case, it's going to be the parents base, sir, um, to sort the cards in. Okay, so we know. Okay, we need something inside that spacer, and we're gonna place all the cards later on inside that when we're insane. She ating those later on. There's also going to be a particle system. I was showing all the answer. We can create this, um, at this point as well. Currently, I just leave this alone. I believe so. We don't need to take care of this one for the moment. It's not so important on the next one airs. Maybe make a note in here already. Go facts. Um, and the next one is going to be maybe a score. So a basic score we're gonna get when we make one match. And since we later on, we'll have that multiplier, which is actually the combo system. We're gonna integrate as well. We want Teoh match that particular score points and calculate this times, whatever the combo. Eso, the calm board said I was going to be the multiplier, and we're gonna take or youth or make use off a specific match score off time. Intense This case, you can also use floating any other stuff you like. And I just said this 1 to 100. I'm And of course, in this case you can do it again. You can create another header in here where you actually remember, Um, this is going to be the the score per match. So the basic score per match, basic score per match. So put per unit per mentions case. And we're gonna make use of this one later on when there wasa a match in this case. Okay, so that's, um basically anything for now. Maybe again, they don't. We go in and add in the particle effects. Sista are particle of fact in this case, um, and we might want to go later on and use another list for maybe some final screen where we're going to create a lot of particles. Or maybe I don't know, some fireworks. Well, it's up to you what you want to do later on? Okay, So the choices in here, we're gonna later on height, Those in the inspector, since we don't want to pass in any data by hand in this case, um, So what we want to do is I want to play or fill of the playfield once we gonna start the game. So that's what we're gonna do it for us. We're going to create a little help of function for this one. I just knowing Name this one, Phil of the Playfield will play field. And what we're gonna have in here is actually we lived through the amount of pairs we won t play on DSI if Ah, we're gonna take all of that from this. Ah, yeah, And Zach, if we're able to play that far or that much, um, at the moment, we just create a little fallen to actually get stuff into. So what we want to pass over is, or actually, what we want to do is we want Teoh counts, ruled the amount of towns, times two, the parents in this case, one pair means we're gonna have to value. So we need to take the parents. We want to play and calculate them times to since we want to have two matches per well, yeah, per per man for card peace in this case or something. So in this case, when we type in four parents we want to play When we Then we would have eight currents. One, the pay feels. So why? I was smaller than Paris. Times two. So, again, this is the card matching we want to make you want to get into. Also, I want to pass this inside, Um, some bright braces just to make sure that I'm not over doing anything in here. Um, and we want to increment. I wild. We're looking Swore off that by one. Okay, so I hope that makes sense for your So for every pair we're gonna set up, we're gonna have to currents in this case. So when we want to play to parents, we want to have four cards in the war game. Okay, So what we want to do is going to, uh, instantly eight a new game object or just name. It may be new cart. What we can do is with that, Actually, when we I do like this, we can we have the possibility, even with we don't need toe, we have the possibility to put in any debt while we're filling in the field. Um, even so, we don't need to create a new instance, in this case since we're gonna store all that directly inside the list. But since we want to store it, we can just take the new carton name in this case and use that toe pass or the data over. So the new cut gets instant. She ated in this case is going to be our card prefab. We want to instance she ain't comma, and then we're gonna have the transform parent. This is only working in I believe you. 95.4 and over. Um, but in all the versions, you need to actually set the space or directly after you have instant created this one. So you need to say a new car don't believe transformed pet set parent. And then in the space in between, you need to say what this is going to be about. OK, so we're gonna set now. Our parent and the parent in this case is our space of the space that we're gonna set up or have set it up in here. So we set this directly into the center of spacer if we didn't forgot those. And now we want to fill our lists. So at first we want to set our button lists dot Add on What do we want to end? Of course. We want to add new card. Um, and we're gonna do the same for the hidden button list. Hidden button list. Don't add. And Olga's Prentice's we say your card. Um, sorry. So and that's basically everything we need to fill the complete playfield at start. So And since we want to do that at start, we need to call Phil. Um will play fueled at the very start. Um, yeah, so that we gonna prepare the battlefield ones. We're gonna start. I actually not the battlefield but the play field in this case. And now let's see, what of the card manager is going to tell us and what kind of info? So we're gonna be able to pass over at the moment. So what? You can see we're gonna have our Sprite list currently and nothing in because it didn't care. Take care of this one anyways. Then how many parents do you want to play? In this case? We can maybe entered too. We can also go in and pass in any other amount. Now we want we need as we need to cut. We've happen here. So there's also that a number as we go to our prefab smolder and we're gonna take in our cart or you go and to the little point in here and set the card directly from that. They were gonna make need to space a game. Object space actually is over here, and we should be able to pass this one over as well as you can see. No, it is inside. The direct transform currently have a matching score, and choice is one into, which is nothing. We're gonna take our off at the moment. So when I now clear the field wizards two cards and gonna press play, I should have four counts directly inside. Um, my playfield. And that's what you can see right now on my four currents are actually matching directly inside the group layout group. We don't have any stuff inside of that, But what we do is was that we can actually know sent a card manager to be, maybe play for, um for parents. So we're gonna end up with eight cards in total which are matching directly in our grid now , group and that's what we want. We want to have it as easy as possible as a designer or a game creator. Or actually, we should be on. We want to be able to give other the possibility to set up any kind game card amount, whatever, depending on whatever, we're going to set it up again. We need to make this a dependent on this brightness later on, um or we're gonna get an argument out of range since we're not able to look through that because the Sprite list is not long enough. So there might be is something we're gonna use later on. S a help of function in the in the scene as well, or in the debug console. That's why I have my consul always next to my game fueled. Um, okay. And that's what we gonna have at the moment or want to do now is we want to shuffle our cards and set, um, depending on the Sprite list, set up the cards with the correct data. I want to do that directly after we have filled the play fueled. So what we will first want to do is we want to create a new help of function for this one. So I name this wonders. Shuffle settled cards can type today off close parentheses. We don't Don't need to take care on. We don't need to pass on any arguments in this case. Um, So what we want to do is we want to create a number at started zero just temporarily. But while we're shuffling through all that cars and a crim entered by one once, we're going to start with the first pair. That means when we're starting with zero gonna show you so into numb. That's just a number placeholder in this case is going to be equal or set to be. Zero need to be said because otherwise it's not completely correct. Um, I'm working in this case. Otherwise, you might get an era when you're not setting this 120 at that point. So what we want to, um, we want to take is the maximum compare amount we a possibly able to play. And we want to fill the data directly depending on this. So at first, we gonna store a card pairs amount. So actually, the cart tears. Actually, that's a possible con pair amount. We're gonna set this one equal to the button list since we already created the button list and here and added all the pieces inside of that and in the but in this dot count. And we're gonna divide that by two. Since when we gonna have, um, when we gonna have set this 1 to 2 as a parents? And here. So we're gonna we want to play to parents. We will have four carts. But since we only have, um actually we gonna multiply everything by two in here, we're gonna need Teoh Divide that by two back in here. Eso we know currently how many car pairs were going to play. Actually, we don't need to do that like this. We could also directly take parents in here, and since we have put it this one directly inside of this but I would just want to make sure that we don't overdo it with that eso we only take in force which are directly inside but a list since we gonna decrease the amount off the botanists in just a moment. So now we created four loops and we want to for ah loops rule the card pairs amount we want to play and also want to increment numb by that. And we want to make sure that we only set the i d to the particular looped through cards to any card in Exodus Kato to any cart on that two times. So the first loop, which is the 1st 1 in here, is going to count the amount of card pass we're gonna have. So we say And I'm going to equal to zero and why I is whips while I a smaller than the car pairs. In this case, we're gonna increment I That's the one you already know and what we want to do Once we are in the first loop. And here we want to increment numb by one so you can play. I'm type and numb plus plus or numbers evil one that matter. So now, after we implemented number, we're gonna start with our i d for the cards with number one instead of number zero. So I need to make sure that none plus plus is before the next followed. So in the next, in this case, nested for loops. We're gonna have another interview. Um, going to call this one J in this case. And while Jay is smaller than two, that means we're going to start to count at zero. We could also even go and start counting at number one, but doesn't matter. So while we are smaller than two means we're gonna count from 0 to 1. We're gonna increment day, of course, And J plus plus, what does it mean is this is counting the amount off ID's we're gonna be able to have per card. Imagine this case. So, um, counts, Um, the cards amount per match, actually, on a per match. And since we want to have only two currents, which which are going to have the same i d. Since we want to compare them later on inside the choices, then, um, we want to make sure that we only have to off them. So since we only have two choices if you want to have later on four choices, for example than in need, of course, to increment all the data by two on and Samos here on here as well. So maybe you want to play it to find three matching type of cards, but of course you need to increase the choices, amount and all the other stuff. So and you can and do that. How often and how many and stuff you like and wound. And maybe if you want to play to play on to give the player Ah, harder game. In this case, when he needs to find three matching cards instead off to and so on, you can also do for if you like you. But it would make the game easier, I believe, instead of harder, since he can easier see the world Playfield. Okay, so what we want to do is we want to randomize all the currents indexes, um, or a card I ds. So what we want to do is we're gonna pick any current in the bottom list or button and the botanist and we want to randomize any number in between the amount off the botanist and pass an any i d we want. Which is going to be set, Toby. The one we gonna increment by numb. So we at first let's create the card in next. We're gonna say we're gonna tow calculate a random number in between random would range. I don't want to have a number in between zero comma and the maximum is going to be the button list. Don't count. Okay, So what that does is if the button this is going to have the length of four, it's going to choose in some number between zero and three. Um, so since four is going to be ignored in this case, um, so when we're gonna do that, we can choose that any Oh, yeah, that particular game object which is currently in on that same sport in the blood. Unless we can use the card index as yet the index for that particular card a pick that and give that the number we currently goes through. Then we go and get rid off the one ends of button. Listen, we're going to start all of that stuff until that we matched or the card pass, or in this case, the button. This is empty. So no matter what way we're gonna choose, actually, the card pairs should match the button list amount, at least at the beginning. Off shuffle carts function. So we going on past in a cart, we just doesn't apparent and temper cart, um, card again. In this case, is the type off this cart and which has already the public and I d in here. So we're gonna pass in the end i d from the card manager when we're going through all of that. So what we just want to set is or actually what we want to temporarily save as the button nest ends, grab records and then we're gonna choose the card in next from the list we just calculated in here. So any and the random card from the car from the button list is going to be stored in our attempt card in here so we can pass over data. So what we want to get from that is, of course, a component off tight cart. I'm close parentheses, kills the line with someone calling. So now we have any random button from the botanist, and we're gonna store the component cart which needs to be or should you be directly on the card? What we want to say now is we want to set the I d in that currents of this This i d we're gonna need later on to compare the matches on Want to set this one directly into the current, depending on the number. We're currently looking throat. Okay, so and that's what we're gonna do. We saying, tim current dot idea. Since we have passed this or actually we've got the component data already, and since I D in this case is a public I d We don't need to take care of anything in here. I want to set this one equal to numb so numb, the one we just have. So in the first loop in this case, Nam is going to be one, um, and as long as it in the next turn, it's taking one as a random number, as are actually random number inside There's a button list and only makes this one once. So we only have two numbers per match in this caper eso. So we are going to fix or fit those inside of that Also, what you want to do is we want to set the cart front for this particular cart. So we say temp cards and don't can't front. Ah, this is going to be off types, right? And we're gonna have a lot of sprites in this bright list. Actually, we have two possibilities to do so we can go its ruthless from up to down and pass all the data depending on what we're looking through in this case by I, um, or we can use that by numb minus one. That's I believe, the best for the moment. So what we're gonna do is car front is going to be equal to write list, um, in square brackets, numb minus one. Minus one is because we're starting at zero, and numb is going to be at least one. Um, since it's going to be added inside of he and the first Lope, we also want to use the Sprite lists. Um, Sprite number zero also element here in this case. So we're gonna de crim int num by one. So we're going to add or actually start at zero. So again, if that is not possible, in any case, because it is no sprite in the list, we would get an argument off out of range or something like this. Or maybe another reference will actually, not in the reference, but an argument out of range. But I need to make sure that Sprite list is at least the same amount. Um, off Paris. Okay, so was that down? We want to make sure that we're gonna remove the button from the button list. So button is that remove? Since this one has been set with their particular loops rule, what do we want? Teoh, get rid off. It's of course, the button list inscribed Records card in next. So that means any every time we're gonna loops present until the carpets are going to be completed or yeah, in this case for all card pairs and all, it's, um yeah, numbers per match. In this case, we're going to go through and the button list will become empty after it's going to be for through all of that On what we want to make sure that what once we had done was fulfilling the Playfield. We want to shuffle the cards. So we're gonna call this shuffle cards directly after the four loop in here. So we're going to start the game. Caulfield, Playfield. It's filling the play food and all the button lists, and then we'll call directly after that. The shuffle cards function, which is taking care off that every cup and the game is going to get one. I D, which is at least number one, and it's corresponding card as well. And give it the same sprite in this right list once we're done with looping throat and that's what we want to make a test off. I go and open my Sprite list once again. If we are trying to play this right now, we would get an argument of out of range since I'm gonna show you this one and the console , as you can see here, since this right list is smaller than the current parents were gonna try to get, so we want to. Passover is, of course, our textures. We just created off cards. Arms are gonna, um, make that little lock symbol. So I'm not losing that. I'm gonna hold down, shift and select all the cards and now direct them directly on so onto the Sprite list name . So, as you can see, we're gonna have all the fruit cuts now inside our game set. Um, I don't need to apply the changes to the prefab. Well, actually, for the sprites, I can do that. But the space that will not be, um, will not be held inside because it's not a prefab or any game object which is not out or any asset in this case, but only directly in that. So later on, when you're going to create a new one, you need to make sure that you connect the spacer inside your new seen. Otherwise, yeah, they will fly around all you get once again in our reference centre space is not available . Okay, well, now when we're pressing play, we should get rid off the argument of the brain. Jessica and see there's no other argument or out of range. Let's just pause what you can see in space that we have or all our eight can't close bond. We cannot check what's insight. So the first card in this case, ham we're gonna need to unlock that on the first card is going to have the i D. To. And since I already made hidden the car in front in this case, I don't know what's currently inside, but I can actually go and on height that pretty quick, um, directly in the card at this point, Um, so you can see what's going to happen inside of that. Later on, I go and get rid off. Um, off. Um yeah, the commanding out. Don't forget to safe ongoing Let's check. Let's check what's inside the first card. So now it's choosen number two I d and the fruit can't to in this case is going to get chosen. The next count has I d one and fruit carts one next one is number four of fruit cuts for next one ISS number three and fruit cup three. Next one, number two. Next one, number three and so on. And so, force. You can check this on your own. So if you would go and reach out for those they should be in any other order. Let me get rid off, maximize and play because we don't need that. So what we're gonna have now is the 1st 1 is no Number four. When I know press playing once again, the next one can be any other numbers you can see. No, it's number two in this games. So it's going to get reshuffled every time and randomized through that complete process while we're going and you created pill shuffle cards. Okay, I close the playfield and the shuffle cards function. We don't need those anymore. we can also go and close that in start so we can see other stuff more and better. So now we need to take care off when we are clicking on a cart that the card manager knows what we have clicked and reacted. And same for the current. Once we are able to make those choices were able to flip the cards So everything is going toe work hand in hand in between the cars and the cart manager. So let's go and 5. #5 The Card Manager 2: Hey, guys, my name is Abdomen, and this is part for off my memory or matching game. The last part. We were creating the card manager and starting to fill up the complete playfield. Depending on, um, all the parents were going to set it up and all the sprites we're gonna have the list. We created the pre five already, so we can use it in other scenes easily without doing too much too fancy things except just passing over the new space. Or in this case, um, and all the cards are going to be filled in automatically won't start and getting its corresponding cart front and its i d. Which we need to make the choices off. Um, what we want to do in this part is we want to flip all over the currents when we're pressing on those, and we want to pass over the data to the card managers. So the CART manager is able, um, to see if the match is a matching. Actually, in this case or not, and flipping back the cards when it's not also are actually sent back at the data to the courts and say, Hey, flip back because you are wrong and so on and so forth. So we're gonna have to do all of that back and forth stuff right now. What we want to start with is we want to click on the Carter. We want to make sure that we are able to on the half way in this case when I actually want to flip the car we want to do is to flip. The card is we want Teoh. Make sure that the card meant just choice is equal to zero at first. So when we are clicking or flipping a cart, we want to request the cart managers Choice number one at first. So So if the card manager daughter instance dot and now we can go and use toys, one is going to be equal equal to zero. So if this is set to be zero, that means, um, we didn't have any card open at that point. What we want to set is we want to set the card managers. Cartman did. Ah, don't instance, don't toys. One want to set this one to be equal to the current I. D. So the card idea we have stored already in here because we got those from the book art manager. So when we're clicking on the card and if it's going to be the first cart, we're gonna click because it's here already. We want to make sure that we set this one to be not to be zero. In this case, at least one then we want to do is we want to set the CART manager once again. We can also or what should be able to catch all the data. But since we have instant access to them, we don't need to, I believe so. What we do is card manager. That instance don't. And now we need to add the choosen currents into the choosing consulates. And since it's a private list because we don't want to have access from the inspector and all the other things, I want to kind of protect those. We want to create a little help of function insight. Um, our card manager. So what we say is Voight, add choose and cart and when we want to pass in as the data is going to be the game object off the choosing part. Um, so we can name this arm, I believe. Well, it doesn't really matter what we name it. Let's see if I have any specific name. Well, no, I just said this one to the name cart. So and in this case, once we're calling the at choose and current, we want to pass over the game object. We're going to get into the choosing cuts list. So when we say is choosing card truth cuts in this case, student cards don't add, so we want to add a game object. In this case, it's the card we're gonna pass over here on. Since we don't have access like that, we need to make sure that this little helper functions going to be a public helper function . So we have access directly from the cart we're clicking on. When we now can do is we can say at choosing cart and we're open close Prentice's we just pass in this game. Object. Don't forget to safe. Um, so now the card meant it just choosing, Or the cop manager gets this particular game object and store it directly inside that private list by using that little help of function in here. I can only do that two times since we want to block the rest off the input later on as well . Okay, so what we want to do is we want to set some bowling's in here. The first Bullen s are at least the last ruling in this case is going to be, well, not directly bowling. But it's going to sit directly on this particular button. And on start, you might remember we're gonna get that button already. Um, So what we're set is button dot inter lips dot interact herbal. We're going to be equal toe Ford's want to set this one to force because we don't want to make sure, or we want to make sure that this same card is not clickable two times in a row. We could also block that by another bull, but using the button director, it's the most easiest way. I yes, at the moment. Okay, so in between here, we want to start the animations for whatever we yeah, for at whatever we want to any made in this case. But this we're gonna need to create some more bowling's since we want to make sure that we only do that once and I'm also only while specific bulletins are true or even force. So those bullets are going to be private, so we don't have access final outside, and we don't need Teoh. So it's private bull on DNO. I just name this one is flipping open so wild this is flipping open is true. Actually, we're gonna flip this one open. Um, So we use that and set this one later on to be foils, and we're not flipping that all over once again. And we want to have another private bull in this case, and I call. This one is flipping knows that means we're gonna have the opposite in this case, Um, when we're calling a specific function, we're gonna create in a moment. Then we're gonna have another private wool which is going to be named flipped. That means once flipped is true. We can actually show the car front. Um, so that means true gonna command this one pretty quick out True means carte front or show car front. In this case, since we want to any made this, I'm gonna show you why we gonna make use off that particular stuff as well. Um, yeah. Now we're gonna have another private one in this case is going to be off type float and is going to be our flip and mount. There's going to be just a number between zero and one, which is deter mining a number between zero and 100%. We're gonna start and zeros and we don't have flipped anything. Or at least in this case, maybe one. That doesn't matter. And so we get can go backwards or forwards in this case just by decreasing or increasing that flip amount so it can start a zero or one. But again, you need to take care of that. Uh, yeah, Yeah, Just, uh what further and you know what I mean. Um, OK, and the next one is going to be another float, which you can set later on. Since it's we can set this one to public. In this case, it's going to be the flipping speed. So how fast we want to flip the cards over that speed. You can set this 12 maybe four at the moment, we're gonna make use off that in a moment as well, while we're going to animate all of that cart. Okay? That's everything we need for that particular button. There's nothing else I believe we're gonna have to make. Use off we want to create is at first we want to open a card over time when we're choosing the first card in this case, we're gonna implement more stuff in that, uh, function a little bit later. Um, okay, since we need to prepare everything for this So what we want to create since we want to open the card over time, want to create an I e nam aerator and I numerator is nothing else. And just a time function we can make use off while the next to update we don't use update because update is always running. And the, um I m aerator can be time by a specific waiting times or anything else. And we can wait inside that independently to the update function. For example, eso the i numerator is running only when we're starting it. And when we are ending this one, of course it just disappears. So what? We want to make sure that we name this one flipped open. So we want toe open the card inside the inside The Ayn Emerita we could use animations for flipping those over. But the problem is that we would need to create animation events directly on the card, which ah often trouble some. So we're gonna use some easy coding in here. Um, to Teoh Fake of flipping. Since we don't have to sites on our button, we only have one side on. And that's all ways. The same side we're gonna see from the camera site. And we don't have any backside in this case. Are we gonna change later on the card back with the card front while we are inside the i n m aerator while we are faking the flipping. So what we want to do is while inside the iron numerator while we are having the ISS flipping open while this bowling is going to be true and the flip amount is greater zenn zero. That means we start at one currently, so it means it is just 1% flipped. In this case, if it's at zero, a wild greater than zero, we want to go and shrink the flip amount or increase it depending on how or in which direction we're gonna go. Since we are requesting a greater number than zero. We want to decriminalize the flip amount. So we say flip amounts hopes minus equal. And now we're gonna take the time dot Delta time, mom times the flipping speech. Uh, looks Pete. Okay, so what we do, it's wild. This is open. While this is bigger than zero, we're gonna decry meant it by the current running time, in this case, times the flipping speed. So, um yeah, and what? We also want to make sure that we are clamping the flip amount. So we're not going over one and no, and not under zero. So we're gonna use massive dot Clem, um, not clamp. And what we can do is we could use the usual clamp since the minimum and the maximum value is going to be something in between zero and one. We could also use a clamp 01 That means it will automatically claim between zero and one thing. We can make use of it. So no matter which one you do or use on, you need to import the right data. In this case, in this case, we're gonna use claims they were once. So we just clamped between zero and one on. What we only need to pass in is the amount or the flip amount we want to pass inside or actually want to plant in between there and one don't forget to save often. Um, what we want to do is, while we are also flipping open and the flipping amount is bigger than zero, we want to set the transforms our local scale. So we're gonna shrink the card down to zero, depending on the flip amount. And we scale this one down. So what we're saying is transformed dot local scale gonna show you this one in a moment so the local scale is going to be equal to a new vector three. And what we want to flip is, or actually what we want to scale is on the X exit off X excess off the cart. You could also flip it over at any point or wherever you like. In this case, this going to be the flip amount is going to be the X value. The why well, you in this case is going to be well, the current trends from the locals gay on God. Why so transformed? Don't local scale dot y since you just don't change anything on that and a comma and the last one is going to be the same for the that excess or the access so transformed the local scale of that or the Okay, So what we're gonna do is we we, um a scale, the axe access by the flip amount until it's invisible. Once we gonna flip that over, I just want to go in and we don't return anything. So we get those little errors and here we I don't care about at the moment. So what I want to do is, let's let's assume we have a cart inside our spacer. What I want to do is I want to use the local scale, which is this one in here, and I want to reduce the size. So it is looking like it would flip over. But we just scared this one down to zero. And after we have scaled this one down, we are able to change the Sprite Onda. That's what we want to do. So at first we scale this one down until the flip amount is at zero. In this case, it's going to be clamped at zero, so it will not overflow or anything because off the clamping in here. Okay, So once we have flipped this one or actually transformed this one and it's completely zero , we want to react to it. So we request once again here at this point, if the flip amount is going to be smaller or equal to zero, just in case we under doing anything, we just want to make sure that we still reacted. So if it's smaller, equal to zero, want to set the image that's bright to be equal to the car front? That's right. Does not need it, since it is of time strike already. Also we want to do is we want to set is flipping open is going to be equal to false. So we go and do not Actually, we're gonna leave the wild loop because of that. So is flipping open is going to be set to be false, And what we also want to do at that point as we want to set, is flipping close to be true, since we want to actually turn the card once again in the Visa Bertha direction, and that's what we're gonna do in here. So we said is flipping close, um, is going to be equal to true. So we do the same stuff just but visa versa on, we're gonna copy all over that stuff in here and make the same years because we're gonna flip all that stuff back, but instant off decreasing that you want to go and increase it. So we're gonna pay a copy all of that stuff in here's and create a second wild loop under the first Wild. And what we want to do is we want to change this value to be, yes, flipping clothes. So while it is flipping clothes and while the flip amount is growing smaller than words smaller than one since we're gonna return the world, Dana, we want to increment the flipping amounts. Also, we say, plus equal time, no doubt the time times, flip amount. We still claimed that we still set the scale, and when we want to do is if the flip amount is greater or equal toe one since, um, why, as once it is going to be Ah, yeah, sorry. Greater or equal toe one. We want to set the image sprite Well, we don't need to set the image right in this case, we just delete this one. But we want to set is that is flipping clothes. Toby falls. So we deactivate the flipping clothes. What we also want to do s since we don't return anything. And while we are in the while loop and we have not done all of that stuff insight, we want to say we want to yield return. No. So while this all of that stuff is not finished, we want to wait. That's actually everything we're gonna get from that. Same here while so after we have done all of that stuff and we gonna be able to call or actually with the wild Lupus finished in this case and we not returning now in this case will go forward into the next part. Same here while we are in that loop and waiting for all the stuff going to happen and waiting until that flip amount is going to be greater than zero, we're gonna your yields re tone No, as well. So once we are done with the second wild loop, we're gonna leave it so the enamel Barreda will be ended. And while we are doing all of that stuff in sight, we're gonna have to wait onto Ever seen this done, actually. Okay, so what we want to do is now, since we have the flipping open already or the flipping open functionality, we want to make sure that when we are choosing this particular current, we want to start the core protein, the A numerator, um, to be flipping open or be able to flip open. So at first need to set. It's flipping open to be true. That's what we're gonna do next in here. So we say, is flipping open is going to be equal to true. Otherwise, we are not able to stop the authority incorrectly because we're not able to enter the wild loop. Okay, same four. This what we now do is we're just saying we start the core routine, which is our flipped open function. Let's open. Open. Does Francis is behind that. You can also type the functioning in quotes. It doesn't matter. Okay, Now what we need to do is we need to set the flip current function for our button. So where we go and do is we go um we're gonna check this era in the second. And what we go is we goto a prefect or car prefab. And on the on clicky Wentz, we're gonna open this one up and drag in the same prefect inside of this go to function card and say flip cart. So we gonna press on the button and we should be able to flip the card. Um, don't forget to save the scene. Maybe in between, and just names, one demo or tests or something. So you don't have to do all of that stuff as well on Let's see where the Aurora comes from . Maybe that's just a typo. So to get rid off the ever we just have as actually we just need to make sure that we set at the choice to be equal to the i. D. Instead of comparing it was idea which would be that particular operator. Okay, so and to continue, um, we can actually also go into the same functionality in here. Where's the I d number two? So what we do is we copy and paste this one all one say else if card manager equals two choice to in this case or actually cut manager instance. Choice to is going to be equal 20 We're gonna set the choice to to be the i d off the current. So if it is zero, but not this one, um and of course, we are able to flip open the true we can set this one here as well. And of course, we can set the button to be not interact herbal at that particular point and clear. Um, actually, that, um, yeah, that card also were not able to choose that a certain time in this case, what we also want to do, The very end is on. What we don't have at the moment is we want to compare at that particular point in the match or the cards. Um, and where we want to do that is we want to do that directly in the CART manager because the card manager is the only one who knows both choices we gonna have done in here. Okay. And that's what we're gonna do. All right, Now, actually, before we go into that, I believe again already copy and paste the flip open functionality in here, since we also need something to close the card over time after this one, The one I do. So I just rename this one and, um, names one flip close. And what we don't need to do is actually we cheat. Need to choose the car front or actually, just a sprite Onda and put the card back inside of that wild. So while we're flipping and closings and stuff, we're gonna set the card to its card back when we were flipping this one back later on, also at the very, very end after the second wild loop. Before we go and leave all of that, we want to set button dot interact herbal is going to be equal to Trow. So we are able to click on those buttons we have flipping back, actually to be indirect herbal again. Otherwise it wouldn't broke Andi. That's pretty much it for the flipping clothes. In this case, everything else is going to stay the same. Just the image is going to change, Okay, since we have that that we just later on created close card extra function here, which is actually not doing anything but flipping the are actually starting the Corentin flip close which we are going to call later on for the carnage as well. And to make this one already, I believe to complete the card. I believe we're gonna create this one pretty quick again. We just take in the argument or actually, we just set, um, the is flipping open to be true once again. So we are able to flip open and start according flip open while, um, we are We are calling the clothes card functionality. That means, um yeah, and actually, in this case, we're not starting the Corentin flip open, but flip close. So let's create this one product quick as well. So we're gonna have the card in this particular case completed. That means public void. Close cart. Um, again, this just help a function from which we are calling from the card manager. So we want to do is we gonna set the is flipping open to be equal to true. Otherwise, we're not again excess ing or possibly accessing the while loop in this case, which is in the core protein and we're going to start the car routine, open close parentheses and we want to set flip close in this case overdose apprentices after this one. Or call that with a string. It's up to you. How you want to call this in this particular case? So we're gonna call that we're gonna close the card when we're doing or when we're calling this one and flipping everything backed with normal state. Where's on the car? Backside? In this particular case, what we can also do is already we can hide the stuff in the inspector. We don't need to see in this particular case. Once again, it's going to be the idea. The sprite for the front card. Don't forget to safe on. And then we're gonna protect all of that. Things were not actually need to see in that, but they need to stay private public. Otherwise, we don't have access to it from other script in this case, except they would be static. But making this one static would also, um yeah, need us to make more changes in total. Okay, so now we have the clothes card. We have the flip card close and flip card open. Now we want to compare The cards were going to input, But before we go into that, I want to make sure that there are no arrows left in our seen in this case. Um, so we can check if anything, it's okay. And we can test if we are able to open the carts. So this is the 1st 1 This is the 2nd 1 and actually what you would have in here, we would have a match. And those two cards are not interact herbal. So we can also not open anymore carts. And those two are actually choosen. And actually, those need to be get rid in. So from that button or hidden button this we're gonna hide those things as well later on and off course, we need to clear off whatever we have chosen. And all of that needs to be done in the card manager. So as you can see, the animations are working. We gonna be able to flip open all the carps them, and at least we gonna be able to flip them at all. We just later on need to take care off that we're gonna call um, the compare cards from penalty in the CART manager. And that's what we're gonna create right now. It's an other m i E numerator since we want to have some time in between Ah, where we are able to store the cards in our mind Like when we opened those we want to have at least 1.5 2nd maybe two seconds. And to remember those cards and dio to store them in our brain. And after this yet we're gonna do all that. They're comparing things. Otherwise it would just be too fast And we would we would not be able to really remember the second card. Okay, so I would recreate. It's a public you numerator It's going to be public because I want to excess this one from outside at least from the second chosen cars and we call those or I call this one common pair cards often grows fantasies, of course. And of course, we're gonna put all of that stuff and curly brackets don't forget to save and we could already call the functionality off the I numerator which is currently not returning anything. But we will go and do that in a moment. So what we wanted set is start Cortina and an open close parentheses. We want to store our started Corentin in the card manager the incidence dot And in here we gonna have on the compares carts Functionality compare carts once again, open close parentheses after this run. Since it's a function we are calling and that's it. Now we're gonna call or start the core routine in the card manager, which is currently in here currently empty. But we're going to do is of course, you want to add the functionality already to this one. We want to check this if this, um, numerator is already running. So at first when we want to make sure is that if choice to is going to be equal to zero, um, we don't want to Acto any or want to react. Also, we're gonna add an operator which is an or operator to pipes, um, one after another or choosen is true. Eso if one off those is going to be, um, yeah, whatever they are. So if choice to is still zero or we already have choosen the second card in this case, I want to return. So in this case, it's called yield break. We're gonna break out off the complete, um I numerator We don't want to go further into that. After that, you want to ascend choosen to be true, chosen, going to be equal to true. So that means we're gonna protect with that levels of state man that were only running this compared cards I e numerator once and not multiple times. That's the, um that's what we need to take care of. I believe it should also be enough just to use chosen as a protector. But maybe there are Some were choices were not able to see, um, while we're coming. Yeah, creating this one. So I would just want to make sure that no one off those are at least true off water getting on whatever they are. Okay, So what we want to do is you want to wait for a little moment I was talking about Ah, that one second ago. A minute of something. We wait for a different amount of seconds or a specific amount of seconds. In my case, I'm gonna create a 1.5. So I want toe wait 1.5 seconds just to give the player the possibility to remember the second card he actually has seen or actually has flipped open. If this time it's for you too long or too short or whatever. You can always go in and change it, but don't make a too long. Otherwise, the game would be just too easy. Now what we want to check as if we have a match or even know match. Let's that was no match. Once again, I want to make sure that we don't have any double problems or anything. We have not to taking care off or even if we just gone too much, Um, forward would we want to make sure that everything is 1% they I'm yet correct in this case . So what we want to do is we want to check if the choice is not going to be equal to zero. And of course, at the same time, I want to make sure that choice the tube is not going to be equal to zero as well. Even if we wouldn't be able to excess it, I just want to make sure that all office that is working properly, don't forget to Clem those inside one Perper pair off Prentice's. After that, we're gonna use the and operator so we won't also make sure that Tories one and choice to are not magic. So if Choi's one is not equal to choice to, then we are able or actually, we know we got no match won't want to do at that. Particular point is they want to flip back the Opens cards and only those on. And I'm gonna show you this one how this is going toe work and what we want to set later on . Maybe here is set up or actually reset the combo and the scene, um, or actually in our score manager if we're gonna make this one later on. So what is all of that about Is going to be in another video, of course. And since it would be just too long for this particular part, Okay, so when we have no match, we want to flip back all the carts. We're going to create the help of function. Just a moment. So let's finish up at first, The item a Rada else if so, because that's not the case. But there is another case. In this case. It's going to be the complete same statement, but with one toe, um, difference. We want to make sure that we're gonna have a match. So Toys one is going to be equal, equal to choice to. And in that case, of course, we want to remove the match. And we want to remember some things. The 1st 1 is we want to remember the last match. I d is going to be equal to toys one in this case, you can also use choice to doesn't really matter a zoo, long as it is not zero. Then when we want to do is we want to add score when we later on create the score manager. And then once we have that one Teoh, remove the match. We're gonna create that help of function in just a minute as well. And we want to do this. I want to clear choosing cards, um, Jews and carts. So what we did is actually we gonna added those chosen cards with at their game object inside the chosen cards list of what we want to do it. That particular point is I want to clear the list. So we saying choose and currents don't clear. So we clear the complete list. It was everything inside and reset this one actually 20 with no elements in anything. That's a cool thing about list. We can just easily clear them off and no item is going to stay inside that list. So we don't have any connection any more to whatever there is insight. Okay, the next one is yet. Let's create those help of functions. But before we do that, we want to make sure that after the second, if statement or in this case else if statement, we want to resent all choices with that or choices. Pretty simple thing, actually. So what we do is choice. One is going to be equal to zero. Choice to is going to be equal to zero and off course we want to set choose him to be Ford's chosen in this case. Once again, it's the i E numerator protector, which we are going to set to be true at the very beginning. And if that is true, we're gonna break out of the follow up so we only do or reset shoes in at the very, very end. Otherwise, there will be a lot of problems and what we can do it the very, very last as well is um, check if one. So we're gonna check if we gonna have won the game. And that is just checking How long the list off the hidden or actually, the hidden botanist? Yes, eso If it is greater than one off course, we don't have one. And we don't win the game in this particular case. But, um, if it's not, of course, we're going to return and not do nothing. In this case, Yeah, we don't need to show any why the time is going to go forward and were able to play forward until, well, actually, until we actually have one. Okay, so what we want to do at first is if we have no match, you want to flip back all the cards or the open cards on? That's what we actually just need to do. We need to kill on Call the clothes card functionality from all the open or, in this case, all choosen carts. So let's create to fill little helper function for this one, um, to flip them all bank. So it's just ah, regular function warrant, flip or back whips. I didn't meant to flip on back to type it all in Ah, all uppercase. Okay, so flip all backflip or back just takes all, um, all items inside the choosen carts. I get its card component and call the clothes card functionality. So how do we do that pretty quick as we're gonna use it for each sense, it is easy. I believe that a four loop or well, actually, it doesn't really matter. Both are about the same speed. I believe a bit for each might be a bit easier or faster. So for each game object called maybe card in the shoes and cards list open doors for her own curly brackets. And inside, we just say card cards. Dawn to get component. What we want to get is the card component on their particular game. Object. What we want to do is we want to call already the clothes card functionality, open close apprentices in the end. And that's basically it for this. The only thing is after we had done was that we want to clear the choosing carts list once again, since otherwise it would also flip back all the ones. So, um, flipped car choosing cards Not clear often close brand disease and the very end and close The line was a semi colon. Not forget to save in between I don't want to do is we want to call flip all back once we don't have any choice or actually no match. What we can do with that already is we can check if the Cartman just reacting to that. But before we can do, I believe we're gonna have to implement the core protein. Are we already have this one in the card. So nothing to change another press play and see what's happening when we're flipping those around and we're not matching. You can see that already. Go and flip back and they're gonna be get sets back, um, to normal. So I know 1% sure, if you have that already. But if you don't, you can go to the cart prefab. And since we're setting those to indirect herbal to be falls at the color, the disabled color is going to be set toe one and 28 in the Alfa. So if you don't want that, of course you can go and direct the Alfa 21 255. Otherwise, they might look that transparent, kind and you don't want to do that. And it might, um, not to be cool for the player while he is going. Teoh throw the game and playing well, that stuff. Okay, so having no match is going toe work. Um, so but what we do is or what we want to do is when we gonna have a match. We want to recto this a swell. That means, um, we want to assert can seize ain't gonna stay opened at the moment. But the problem was that is, um we don't get any score and we're not removing those. Well, actually, I believe so. We're not removing those cards from the hidden button list. So when we are going to our CART manager, as you can see, it is still all off. That stuff is in here. What I want to achieve is I want to make sure that the hidden button this is going to become clear eso we can. When we have done the game, we want to make sure that the hidden button list is clear. So if the sizes smaller than one in this particular case, then we can call Hey, we won and everything is cool. So currently off course we have one. But we have nobody which is removing this match. And nobody can check if everything is cool again. As you can see now, the game is working. All the buttons are not indirect herbal anymore. And so on so forth. The basic functionality is done. But once again, I want to make sure that we gonna disable all of that stuff in our removes of match function. So wouldn't want to do is we're gonna create a little help of factual once again after before or wherever you like that flip back function. So I want to remove the match. Open those brand disease after this one. Um, well, no semi colon in this case. Okay, Okay. So open, close curly brackets. And inside, What we're gonna create is a little followed. The for loop in this case is going to go backwards from the end off the hidden button. This to number zero, um, off the nama zeros item. We need to do that. Otherwise, it might be trouble some for, um for that. How shall I say? Well, it might be troublesome to get rid off all the correct items, since it might know do look through all off them. Maybe that's a possibility to do that with for each in stand instead. So it might be easier, um, to prepare all the or actually to compare all that stuff. But I will show you how you can reverse a for loop. So what we're gonna set is I is not going to be equal or start at zero off off the list. But what I want to do is I want to have the hidden button list. Don't count as the first number we're gonna start off. But we need to reduce. And by one, otherwise we're gonna have an overflow. And while I is bigger or equal to zero, we want to decry Ament. I So I minus minus. That's away One way you can actually return or actually reverse a follow up. So instead of going from zero to the hidden button counseled button, Mr Count, we're gonna do that. We're gonna de crimen this or actually said I to be the full number off the hidden. But nus and count backwards Why were decreasing the I element while I a smaller in this case greater than zero or greater or equal to zero. Um, okay, so what we do as in that fall of we gonna store the card once again on the card component on the black in an attempt cart component. What we want to store inside is, of course, the currently looked re hidden, but list botanist item. So hidden button is that, um in square brackets I don't or we want to get is, of course, a component off type card, often close trying a brackets and sites type card and the very and open close parentheses. Closer line was a semi colon. So now we can't should that cart we are currently looping through in this particular case, back what's ums? Rules of complete for loop or a source of complete list and store that inside. Now, what we can check is if the temp card I d, um 10 card daughter I d is going to match our last match ideas going to equal equal to last match. I d then want to react to it. And in this particular case, you want to remove it from the hit button list as well as maybe play a particle fact so for a simple, important goal acts effect. I don't know. And remove the course morning card from the list. So how do we do that? Actually, we just say written hidden button list Don't remove at And where we take ISS the index I that's I own Next, 6. #6 The Score Manager: Hey, guys, my name's up demand and this is part five off my memory game tutorial. Serious in this part. We would take care off the time, the score and the combo system. I already explained in the beginning, and also we gonna count up the terms and we want to make sure that we are able to restart our game. So what we need is actually just one more script at the moment, which is actually taking care of all of that inputs. And we want to make sure that this script is also reachable from any point in the game or from any other script we're gonna have. So currently we only have. Our two scripts were already created in the last four videos. Eso That's great in your one. This one is going to be in my score manager. So with the score, man, that just group is taking care of any points, any at the timer and the score and so on in support. If we don't like the name score manager, you can also rename it to whatever game manager or something like that because it's actually doing the same. So what? We also want to do is we want to create a new empty game object which we gonna rename Teoh . Yeah, Score manager. Of course, we can now already dragged the score manager script directly on the score manager game, object. So what we want to do is of course, you want to open this one up, since we need access to new I elements like the tax elements who want to make sure that we implement the name space using unity engine, don't you? I and also since 12 later on, restart the game with the button. We need to make sure, um that we're going to be able to use unity engine that scene management as well. Okay, Was that zoom in a bit. So consist of better was that we actually don't need anything else. At first. We want to do is you want to make sure that the score manager is going to be a persistent one or actually aesthetic class. We access or we have access later on from any point in the game, as I already I'm set or explained. That's what we're gonna start with the first we're gonna create a new public static score manager Instance. So the name is it basically just at the instance Going to with the name it can cause rename that whatever we want. But we want to make sure that those two were going to match. Also, we wanna create a new message. And here which iss unities awake message and inside of a wank, we just want to say instance, it's going to be equal This that's basically it will we need to make this one accessible from any point in the game. Okay, so the next one is we want to take care off score. So I just make a little command out here so you could do that as well. So you need on know what all of that stuff is about? Um, so I create a new public in my name. It current score. Actually, we don't need to have this in public, since we want to create later on some conscience which are accessing current school from any other point I'm or actually where we're gonna use that function to actually protect current score. And we could do that or actually make this instead public can create this one as a private one so there is no other excess, except you're gonna try to reach it. I wasn't help of function in this case. Um, anyways, for now, we're gonna keep this one public and s so we can see how this is going toe work. And if it's counting up, everything correctly are not okay. The next one is going to be about the combo. Um, and the turn. What we want to create at first is a kumble amount and a turn amount. So the combos are going to be calculated or actually added up. If we have one match already and we're gonna have a second match as well, this will automatically count up the combo value in this case is going to be protected or actually a private one. I just call it current combo amount. We're gonna do their private since we just excess that from another help of function, we gonna create in a moment as well, Then we're gonna have another public one. We're at least for the moment. This is going to be our current turns, which we need, um, to count up while we are, um, while we're doing some matches in between every time we're gonna have a match. Current tone will be increased by one. Um, so we can count this one up? Actually, we can also create a little help of function for this one. So we are able to protect or actually hide that's with this with the private value and were not able to exist it from any other point. Um, in the game. Um, so the next one is going to be about our play time. So how long are we playing the game? Maybe you want to have later on some kind of achievement system or anything else where time could be interesting for the player itself. So what we want to do is we create a new public end call this time, so this break time will be later on, counted up just over time. Actually, by using a nine am aerator, we will go into that time once again later on. We'll also want to use is seconds and minutes. I'm gonna make them private as well on. Of course, I will explain all of that stuff why we're gonna need them or use them to show the correct time and actually calculate how many minutes have been already run. And how many seconds have run already? According to the current playtime? Okay, then we're gonna need some text connections. So those text connections are basically all the time. Tax the score. Texas comma Texas turn text. What if you want to have it a bit more? Um, nice. Once again, into your into your inspector, you can create a little header in here. Where's just ahead? Attack Open, close parentheses and in quotes. We just say may be taxed on actions or something like that. Eso You know, you have to drag stuff inside of that. 1st 1 is going to be a public off time text is going to the our time text the next one again. It's a score text clearly saying public next score text was a big tea in the centre for me . You can use your own name implementing if you'd like to. Public taxed. This one is going to be whole combo text so we can see how many combos or how big the latest combo is and we gonna have the turn its text. So how many turns have been run, But that of just the output values are actually the tax we already have created in the canvas. And that's basically everything we're gonna need. Well, at least for the moment, to drive everything inside score and manager, let's go and create some help of functions. So we are able toe update this cortex update time and update. Um, the combos read that combos and all the other stuff. Let's start with the time. And I believe that the easiest one here, we're gonna I created. I enumerated. I just named dysfunction play time. It's going to be basically just a private one, which is just running, um, the wall time Once we just started and to make sure is running the whole time, we just type in. While true, the wild, This is true and nothing changing. Are we gonna run everything which is inside that Kohli briquettes somewhat. We're gonna deuce. I'm every time we're gonna create eight and I enumerated We need to yield return something without the youth statement. Nothing else would Oh, actually would get some problems or actually, some arose when you don't yield anything inside and I enumerated. So what we want to do is we want to yout return knew what was going to do. You want to wait for one second? So it's a wait for seconds and records or in parentheses or say one, this one re prudence one second and every second we want to do what I actually want to send a flight time plus Plus, that means we're gonna increment playtime by one you can also on type and plus equal one. But actually plus plus is the shortest way and rather good to read as well. Now we want to calculate the seconds and the minutes so we can say seconds it's going to be equal to on Denim Prentice's We're gonna say Playtime model 60. Actually, we don't need to do that in practices, but I believe it may be a bit more organized. The next one is What we want AM is to calculate. The minute's gonna explain the model you in just a second minutes is going to the equal to once again in parentheses. Playtime divided by 60. And behind that, we're gonna type model 60. So what's model model in this case, this sign in here is just making sure that play time in this case is never be able to be higher than 60. Once playtime is 60 it's gonna be resenting it to zero, but no directly playtime. But seconds, Same four minutes. We're gonna calculate playtime divided by 60. When playtime is smaller than 60 it will return zero or anything under zero. But since it's an inter jet will be rounded down. Anyways, once we gonna be able to have a plate on off 60 and we divide that by 60 we're gonna return a one. And since one hour has only 60 minutes, we're gonna the same model 60 once again. So the last, um, or the highest number And he is going to be 59. Once it's hitting the 60 it will return to be zero. And usually the our would be increased when we would implement that as well. But I don't think we're gonna need that sense. Well, actually, we just, um yeah, I have a little memory game. I don't think it's taken one hour to you, actually, um, complete game. What we also want to do is later on after we are done with that one update, the time or actually the time taxed on and That's what we're going to create right now. So we have all of that stuff together. The 1st 1 airs, we're going to create a new function off type boy troops. Since we don't return anything, we're gonna say update time. So and actually it's updating just time, but the time tax in this case. So what we say is time text door taxed, it's going to be equal to, and now it's we gonna type and everything we want to have in that little time, um, text in here. In this case, it's going to be in quotes time, colon plants. Now we can enter all the values we want to have or want to show. And we can also manipulate them when we're converting those two strings. Um, how we want to format them So we can tell, Um, minutes don't to string. And in parentheses and in courts, we can say d two, which means we want to have decimals and a number off two numbers, actually, unless they can in court once again. Makesem Coghlan's one colder and behind that. We want to see the seconds we say seconds daughter strings. We convert that interview to a string, the very able. So we're able to form at this one, and we want to form it. That two d two as well, so decimal to with the two is actually resent representing how many zeros or how many numbers We're going to see it that point also after we are in the iron numerator at the end and we have calculated the playtime, the minutes and seconds we want to call update time, open close parentheses. Enclose the line was a semi colon. Don't forget to safe. And what we now want to do is once the game is starting, we want to call the I know Morita. In this case, we're going to stop the core proteins and denying numerator is a co routine and we can use two ways that the 1st 1 is. We just call the name as a string or we call it like a method. There are some differences on the 1st 1 is when we are starting in quarantine with two possibilities or actually three to started. The 1st 1 is, as I already explained, we can call it like a function Mike, blame time open close parentheses like this downside is we're not able to stop the car routine this way when we were just calling play time. But we can stop the Cortina later on. We need to stop it once the game has been one. That's why I explain this and we have the possibility to also all that as a string massive name into quotes and this way we are able to stop it directly. Where's the coal stop call routine and then record the function we want to stop. So actually it doesn't really matter for us. And for now, I believe since we want to go on a stop all core routines or running core routines when the game has been one, except there's some other functionality which is running in a core routine or in this case and I number reader. Okay, so that's what we want to do it. Let's go and save. That's one. Don't get too safe often and see. Let's see how low score manager currently is looking, I guess Again, See, we're gonna have all our text connections. We have current score are in turn in our playtime. We will later on go in and protect eight playtime and as well we don't need this one to be public, but we can actually hide this directly in the inspector on making just private. If we don't need a specific access point toe that value. And if we need to, we gonna be able to create a little help of which is able to read the play time for us so we don't need to go directly to the value itself. So let's drag in our text component for our time attacks. Intar aside, the time a text text connection and let's press play. Usually we should see a time or running as against e time colon and then the time as we already created it. If you don't like this, you can also could get rid off the taxed. Um, whenever you please, like Okay, so what we want to do now is we want to get score. So what do we need to get? Score is we're gonna take all the score incoming from the last turn, and we're gonna calculate if there is a combo or not. Depending on the combo or the combo amount, we're gonna calculate score, So we want to have as we want toe at the score from the matches, and the current combo amount is going to be the multiplier. Before we gonna at this, we're gonna multiply that or actually, yeah, multiplied that by whatever the current combo on Mount s. Okay, so let's create that terrible function. We need to make sure that the something is going to be public. Otherwise, we don't have access from outside. It is going to be off time void. Since we don't return anything, we want to add score. And we're gonna and also need an argument meant inside, which is of type, intelligent and is going to be the incurring score amount really, Brackets. So what we want to do is, once we call at square, we want to implement or actually in cream end the current combo amount and the current at turn, and then we're gonna calculate the current score or actually, at two it according to whatever the score amount times the current combo mountainous and at that to the current score. Also, we're gonna update the taxed, um, which we created just a second as well. So, at first, the current camera amount plus plus. So we in grab, Increase that combo Roman Mount by one the cover insurance or current turn going to implement that by plus plus as well. Then we're gonna calculate the current score or actually, we add to it. So Haren score plus equal, we take the current score, or actually, in this case, the incoming score amount. We're gonna calculate this by the current combo amount. I'm gonna efforts to that. And in here we would just go in and update the score text. Speaking off, updating the score text. We're gonna create a help of function once again, which is a type Voight, since it also does not return anything you're gonna told this update score tax in this case closed parentheses and in cold in brackets. We just want to make sure that score text, the combo text and the turns text is updated when we're calling the function. So we say or text, don't text to the equal to and quotes score Golan space. And now we can act a bill usually want to. So in this case, it's going to be the current score, and we can, but we don't need to convert this one to a string if we if we like to in any way next one was going to be the combo text dot text that's going to be equal to now we can say once again in quotes combo colon space Plus now we gonna and the current combo amount. We can also convert this one to a string if we need to and if we want to Um actually, so thousands and one hundreds with some point in between, I believe we're gonna go into that in a second for the score. Maybe so you can see what I mean. And the last one is going to be our turns text door test. Going to be equal to is going to be our current turn. Ondas Well, we can if you would like to convert this one into a strength. Let's see, when we want to have some every thousands, we want to have a point in the score. What we can do is we can again say we want to convert this to a string open close parentheses and once we gonna hit the quote ones, you can see some values or actually, some formats we can bring the numbers in like some fixed points of generals or even numbers was point and the comma in the end. In this case, um, we could just use en as a number use that. And once we gonna hit that the cells and points and score, it would automatically create a point after the Serbs position in this case and even in the millions and so on and so forth, there will be some points in between the numbers. So the readability might be a bit better that's ever seen for the updates. Gore text. Also, once we gonna add the score, want to update all the text values as well? So we call updates, quarter angst, open close parentheses and close the line was a semicolon. Now we just need to make sure that we're gonna add the score amount when? When we actually have a match. That what we can do it in our Cartman injured when we are having a match. We already commanded out that we're gonna have a score in here like at score, which is in our I e numerator compare cards so we can call is now our score manager, for instance. Now we can call the function at score, and it requires our in score amount. As you can see in here, don't call at score open, close parentheses, and the score is basically nothing else than the base score on the match school. In this case, we just say, um, over here in the very top. So let's go down and feel in in the score manager. Instant at score. Whatever our match score is going to be, don't forget to save. I'm basically what we can do is we can now test that is working already. Um, if there are no Ross, I believe it's just because current turn. It's just, um, an Inter Gia without any, um, any string in front. That's why we are not able to convert this. But I believe this should not be needed to convert or to be converted, but see, Yep, that's what I mean. The census is just an empty indigent, and tax requires, um, a string in this case, and we're gonna only put in an individual without any string value or actually something in courts and front or behind. Um, it just don't like it to be not a string this case, but still works now when we m adding this little command line in here. Okay, Time to test first go until the score manager and drank in the score. Texaco mo tanks, the turn text Gore text. I'm a text turns text. Make sure you have renamed all of those accordingly. So you're gonna find those easier. I'm purse played. So currently, we also we don't set anything here. We don't set the score already with something we don't set turns toe. Whatever. But when we are trying to get something in here, um, take the Cherries. We're gonna update is And what you can now see is this is going to be the format. I believe that's not the correct format we want. We're gonna have one combo and one turn, but that's bad. We're gonna need to add more turns because we also have some mismatches and all the other stuff as well. Also, we want to start with some values already when we're starting the game. So what we can do in this case and start, we can already call the update, score, text or, um, function. I will do that before I start the core protein. So everything is set up before starting this one. So we call update, score text open, close parentheses and clothes Line was a semicolon. Don't forget to safe. The next one is we want to update the current turns. We want to add to current turn when actually, we don't have a match. What we can do for this and I can created with the help of function. So we are able to protect us as well or actually set this one to private. So it's going to be It's a public buoyant and in this case, it's going to be update. Parents turn off close friend to seize. And in here we just say current turn plus plus and we also need to update this court tanks . So in this case, we can just say we're gonna set this one toe private so nobody else has access to it, except we by using the ab decor in turn function. So in Cartman and John, when we arm actually don't have any match like in here, we can reset the combo and we can update the matches like the turn. So every time, um, we don't have meant we want to update the score manager and resent the combo and same time I want to set all the terms. I believe we can combine that with resenting the complete combo because it's having a mismatch. So we call this function instead present. I'm mo. I believe that's a better name combos. So it's not just the current turn is going to be increased, and we're not only updating the score, but we want to reset the current combo at that point. So we'll be saying yes, current combo amount go to the equal to zero. So we just reset this one. Then we set Currington plus Plus, I'm gonna I'm day to score. So what we just now need to do is we need to call from the card manager the reset combo. So where we say, reset the combo in score manage and we just can say recent combo open close friend to seize . But beforehand, of course, we call the score manager. Don't instance. And call the function dot reset Kabul. Don't forget to save this one as well. So every time now when we have a mismatch, you're going to reset the combo and at the same time, the increment the current turn. But we have two things we're gonna do at the same time. Okay, Once we have won the game, we want to stop the cover team Accounting are up our time with all of that stuff together. Now, um, we want to stop the core routine. So in this case, I just create another public from the fact Voight I believe we're gonna need that because the card manager only knows if the game has been one or not. So we saying we're gonna stop the timer or stop time. In this case, we can just say stop or core proteins. But if you have laid on any other running Cortines, this is not might not work for you. So we can also say we're gonna stop the car routine, open close parentheses and on clothes. We want to stop the Corentin playtime. This is only working when you start the co routine was the same massive name or actually was the same a string name in this case, and that was that possibility. You only then you're able to stop it with that, um function Call. Otherwise it's not working, and you can instead use stop all Cortines would work as well. All you need to instance the Cortina. Why numerator? Um with a specific, Very able. And then you're able. Teoh, stop! It was that variable name. Okay, so let's a test. I wonder what's happening right now. I won't go back. We want to make sure that we don't have any Ross. And now let's test out. Okay? Lets can't see. Everything is set up so far. Turns zero combo zero score zero. When it goes through and do something, you can see the value is going to incremental every time we have something. Now we have a match and combo is one. If we would be able to have another match now, we would have a double score. Since the combo now is, um, multiplied by the ins coming score off 100 in this case. So let me just pretty quick check the field and use of those are two Cherries. Those are two strawberries. Let's test this out. We're gonna have now a combo off one a score off 200. If we now go and open those strawberries, the combo is going to be too. And we would have 400 points in total. As you can see, it divided the 200 of the one incoming points by two. And the same is going to happen with that to cause a swell since at the last pair. And we're gonna have in the end 700 points and a kumble off. Sri. There you go. And we told you the have cleaned up or actually won the game. I'm with ah, 700 score and on maximum off 10 turns. Okay, The only thing is, we are not stopping the time now since we say OK, we have one. But we don't stop the time in this case, we're gonna go back to the card manager where we're checking if we have one or not. In this case, where I already commanded out Stop timer. We call the score manager once again. Not instance. Don't stop time. Open. Close. Going to see is close the line with the semicolon. Now we're stopping the time when the game is won. Now, what we want to implement is the restart button in here. So to restart the game, we actually just call or request the current I'm seeing. We're gonna have and load that. I'm back from the scene manager into the loading function. Gonna show you this. First, we're going to create a new public point. It needs republic. Otherwise, we don't have access to it from a bottom, um or four from our restart button. I want to say, restart in open grows prime to seize and in curly bracket were just saying demand. Urgent load scene. And now what's the name off? The current one we want to get or want to load actually want to reload the same level, actually, and shuffle all the cards. This case, you're gonna request the current name off the current active scene with C manager dot Get active scene off close parentheses dot name. And this is a new way actually to restart actually is just one way to restart the current scene by getting its name and loading it by the current name. Pretty simple. Don't forget to safe and no prepare arm a button, go to the restart button in the canvas at an on click event. And now we can just input the score manager directly in here. Go to score manager and go for restored level that's it. Don't forget to save the scene in between as well. And this should basically be it for the time to combo and all the other things we already increments implemented that will go into and change some values. In a second, though, everything is set to zero. Except the time is not starting directly. And there we go over and do that in a moment, I believe so. Let's play this one pretty quick and let's test some things out, okay? We're gonna have something. And here we have a score. But when I want to say okay, now I want to restart everything. I can click on this, and everything will actually start all over once again so we can start to, ah, you restart the game. Actually, when we have too many fails, when we don't have the score, we actually want Let's say, um there's a minimum score off something to get a specific achievement, for example. Then you want to make sure that you're gonna um yeah, restart that, maybe, or whatever, Depending if it's just many game or a big one in this case. And yeah, that test, if the timers actually stopping when we won and it does. So it just goes, maybe one more second up, and then it's actually showing us. Okay, you have one. The time has been ended. You have the tools. Score 500. Now, the maximum combo seems to be to in this case, and we have needed or we were needing 11 turns in total. And of course, once again we can go and we stop a complete game. We have a completely different playfield now, since it's going to become shuffled, um, as well and so on. And the force. Okay, What do you want to do later on? Is, of course, you want to get rid of the D Brookline and here, so we can actually commend this one out. Since we already know we have one. You can actually, once again plates and flyovers to some effects on this one. If you like to, and you can go into anything what you want. At that point, you can show some user interface again where maybe the score and stuff is already once again listed for the players. So he's able to go back to the main menu, for example, and so on I understand for the particle effects when we have a match. Oh, actually, when we are removing a match at that point, you can call a particle fact. But you need to take care off that you're not keeping this one in the scene and clean of everything once again was maybe some destroy script or anything else. 7. #7 The Particle Effect: this part, we will create the party cool effect which is coming over once the to choosing cards are basically matching. So we prepare the particle system beforehand. And, of course, we need to form the particles we want to show So and what we start ways once again is going to escape and open of a new documenting Here, it's against you. On the left, there's a start and pull Eigen tool you can select this morning can create polite guns or even stars wizened, different amount off corners. So also you can you derive Or actually you can set the, um, the differences between the two are between two specific spikes and of course you can round them up. I already have a setting off their 20.6 and 0.2. Um, for those surround for the groundings on the spikes and I use a star will create a star with five, um, corners or spice. So when I hold down the control key and can also snap this one directly wire creek, aiding this one in a specific angle of like Teoh and when I am in the top, the stone will be our When I go to the top from wherever I just tracked this one. I can sniff this one and make a very yeah, let's say organized starting here. Next one is when you are filling this one in black, you need to make sure that later on before we actually go on export the star make this one white so we can take this one later on directly in the particle system or even with the code of you prefer to do so. You can design your star or whatever you like. And please, this is going to be the shape were insinuating as particles. So when you want to have some cloud of facts or anything else, you can even use clouds or rings or whatever you like to get some nice visual effects when the player actually found a matching pair of carts. So once it has selected, you can also go into the PNG export once again by using file and PNG export. Or, if you have this one open already on the right side, which is automatically happening when you're basically selecting the option and the ones again, this one will appear. You can now say what you want to export, so it's going to be whatever you have selected currently. Also, selection the complete your document or side in this case, are you whatever you like this case, I will just go and use Bill selection I currently have, and I want to make sure that I'm not higher than 5 12 But it can also or particles just go . Was Warren in 28 in the maximum I eat or even lengths. That is up to you. But usually you don't need to higher than 1 28 Except maybe for four K screens later on. Eso you don't have so much. Well, multi loss once you're done. Was that of course? Name your particle. I'm gonna just called us when? Maybe star. I want to. And you want to export this one? Maybe into your unity folder. I'm off kind textures. Or you just put this wherever you lead, please. Like I will direct this one from here later on or in just a moment into my, um yeah. And my unity folder. I want to make sure once again, that star now is white. I select the white feel. I make sure there is no border around it, so it's transparent. And then I just hit export. No one gets an exported picture, which has, once again the size off 182 pixels by 1 22 because it's not higher than it is a lot. Actually, it's higher than longer or white murder. It doesn't really matter. So I can now make sure that I direct this one from wherever I have this one exported into my Texas holder. And that's what I going and do. Now open once again my Texas Walder in unity itself, I go to my full away. I have extracted this one, too, and reckless one into. You can already go into your Texas hula and export this one, as you have done. Maybe was the fruit cart in the beginning as well. So once again, I go pretty quick in sight and wrecked my star into the Texas Fuller. This star will now automatically be a spring two d and you high if it's not, make sure you change it to this. Actually, it doesn't really matter because we don't want to do any changes in that anyways, so we want to do now is we want to create a material for our stars. So the particle system is able to do, say, display the star so it's and create new material. Call this one, maybe particle story. You're gonna name this whatever you like. Of course. So you find this one later on and into the Albedo Channel Currently way Just select the star we created. Also, you should see now that is this a white star here. And of course, we change this. The shader from standard Teoh mobile particles awful blended. So now we got how we have just the star and nothing else No shading and so on, Just a flat white star. The next one is we want to create an empty particle system just anywhere in the scene. So just go to hierarchy, right click particle system that we can already apply the material directly into the render , which is at the very bottom Over here. Go to default Particle. Select this one. Answer like the particle we gonna have If we're gonna zoom in by just double clicking the particle system, you can see it's already doing stuff in here. But no matter where, I just bring this one. And no matter where it is a kind of zero, this one, I'll just for you to see this one's or go to re set or reset position. Usually we should see this one, since our camera is viewing this part in here. But as you can see in the game screen, there's nothing happening when you see the camera in here, which is the camera. Prevue is seeing something but the canvases overlaying the stars, so we're not able to see the stars wherever they are currently at. As you can see, usually we should see them. But meanwhile, the cameras is active. Gonna deactivate us? You can see now. Yeah, our particles. So the problem was that once again and we need to make sure that the canvas is making sure that we're able to display the stars. And that's what we do in here. We go to canvass random haute and change from spew green paint overlay to screen space camera, and we choose a camera which is in this case, the main camera. Now we can get into the particle system and create eight the effect we want, But first we might want to go in and make sure that it's some kind of birth defect. So the particles are going to be admitted from its center, bursting out in all directions. Doing that is pretty simple. We can just get rid off rate over time. So we set this 1 to 0, and we want to do instant. We want to create a burst as again, See, we compress on the little press on the right, and we can set this one to, um, a specific time and specific a specific amount of particles we want to get. Crew ate it. Since we don't see an easing or just in the seam you and sometimes in the camera, you want to decrease the duration by five, but we can see more what's going on. Also, we want to get rid off the lifetime that we basically want to just reduce the lifetime after the particles are going to become deleted. In this case, maybe zero phone par five, maybe more, maybe less depends also on the speed, so we might want to set the speed to to those air flying further, but still be a fact. It's only in the told. Lang's off 0.5 even 0.7 should be an OK ish amount. But for me, I believe it's a bit too much. I believe your point life is the better choice senior next morning as we want to change the shape of it. So instead of using a coon, want to use a circle and as again, sees the circles flat on the ground to want to rotate this one. So instead of having a minus 90 degree agree on the degree ankle on exportation, we want to set its on 20 And as you can see, it already has a cool burst of fact. But well, it can be better. For example, we can change the size randomly between two constants. That's what we're gonna do. Now we go to start size which ISS over here. When we go to the little arrow to the right and set random between two constants, we can set this 12 maybe your 120.5 and maybe one. Or if that one is too big for you, you can always go into and reduce the signs to maybe 2.8. So all the newly created particles are now going to be randomly size between 2.5 and 0.8. We can do the same with the rotation. So we get more dynamic shapes or don't dynamic rotations at all. In this case, we're going to choose the same reading between two constants between the start rotation or in this case which can choose zero Ansari 60. So all the created Chan, all the created particles no have a random rotation in any degree angle between zero and 3 60 Next one is we might want to tend those stars as well to get some death. Or maybe some interesting, more interesting effect since my current background. This Yeah, yellowish. I will go for the counterpart color in this case, something maybe around bluish, Um, because this might be a well better seen effect. So the start color goto random between two colors on the 1st 1 is for me maybe some baby blue and white currently bottle. So instead of white, I'm gonna go for a super darkish blue, maybe some more purple, while everything is up to you and how you want this to look. So as you can see, this is no our birth defect, which is happening. Meanwhile, we are opening the carts. But that's not all. I want to show you some more to get. This 1 may be a bit more nice. What we can do is we can change the color over lifetime till so this or actually oh, neighborhoods on by the little check mark in front when we are selecting the white border in here, What we can do is we can set a moat between planned and sex. We want to use blend. I only take the upper right handle where we can reduce the Alfa Zero. As you can see, they're blending out over time is that is not enough for you. You can also go and change or create new handles here and change the Alfa so you can increase the visibility amount of decrees. The fainting time to become transparent once you're done was that you can always go in and change that with some different colors. And so it's a force, so you can actually go and blend into the current color you have. But I don't need that. So I just keep it as white and the color itself is driven by the starting color at all. That's cool. And the next one is. We might want to rotate the stars as well over time. So to get some more interesting effect in here, if you don't like the rotation, you don't need to. But what it can do its rotation over lifetime. Activate this, and currently there's a constant off 45 degrees. All there will be rotating 45 degrees from wherever they are coming from. What I want to do is I want to change that to once again. Render between two constants and I'm gonna change is one to minus 120 positive 120. But the stars can now rotate in either direction, left or right by 1 22 Cui's If they like to, though, once again, this is randomly choose now, and we don't have to fear or Annie's have to look into this. And to finish this one up, we want to create a new empty game object, which I just call half acts on this score explosion. You can name it whatever you like, but I want to make sure that FX is stands for particle of facts or for effect at all. And what I want to do is I want to zero this one out in position. So I resent the position. You well, 000 And I want to be sure that the Parker system is at 000 s. Well, if I haven't done that already, and I want to make sure that the particle system is now part off the F X explosion. Now I go to my prefects, Will and drag affects explosion directly inside my prefects. Over. Since I want to use the FX explosion, we've heard later on and instance, she ate this one. When we are opening or revealing, the current are pieces. The next part we will go over and make a little script which we are able to destroy. The FX exploded a fact or gain object after a small amount of time. Automatically, I was just once in line of coat and we want to start to instant. She ate those effects and, yeah, make the game look way better. 8. #8 Using The Particles: in this part. We want to make sure that we are deleting the affects explosion after it's actually useless for us. Also. What? I want you to go to a support ical system and disable looping, since we don't want to look the animation. This was just for organizing and checking everything in here, so we're gonna look through that. But we don't need to loop this since we only uses once and after a given amount of time. In this case, maybe after one second we can get rid off the complete of fact or, in this case, the game object were later on. And Stan Jiating, we go to our scripts folder and go right leak and create a new C shop script and call this one. Delete me, Believe me is just a script which will later on take care off the leading automatically the affects explosion one second or whatever the amount of seconds we want after it's going to get. Instead, she hated. So that's double click this one and opened this one up and model developed or visual studio . Once it's open, we can actually get rid of updates, since we don't need this Also, we don't need this line of code. Of course, we just need to have the start function and it's not. Fashion does not do anything except destroy where we actually are able to destroy a game object. And what we do want to destroy, want to destroy this game object and we also want to have is a delay. After a specific amount of time, we want to destroy this particular game object where delete me is on. We can say calmer and we can set a float, which is the time we want to delete that stuff after we can set this 12 maybe 1.2 f or maybe more, depending on the length off the animation or the particle fact. And, of course, don't forget to close the line was a semi colon in the end. Don't forget to save the script as well, and now we go to our affects explosion. We wait until the complainers done combining everything and we've passed in. Delete me if you want to reuse the lead me later on, all want to have that a specific script, doing some stuff. I'm on other ways. You can always go in and set a public float Elite time If you like Teoh, But you can set now from outside we can say OK, we want to set this one already to a zero poor are toe one point 2/2 and instead using that float we can just pass in elite time. Don't forget to save the cool singers. Now we can use that script where everyone and you can randomly or even just specifically a specific, um, delete time for specific gain objects if you like Teoh, don't forget to apply the changes to the prefab so that the lead me script is now inside the prefab as well as you can see here. And now. If you change anything and you like the delete time, it will automatically update it to everything else. Now we can just get rid of affects explosion game object because we don't need this anymore . And now we can get into coding the card manager, which is taking care off the explosions in the or actually the instant she ation off our yeah, prefab. What we do is we go up here where we're creating our one knew very able. You can also use another header for this if you like to. To keep stuff organized, open, close parentheses and in here you might want to have something like the facts. And after this, we're going to create a new public, full time game object. And that's going to be our half. Thanks. Explosion effect. Don't forget to save on symptoms public. We can now drag in any effect we want into our prefab cart manager and create the FX explosion at any time we want. We can now go down into the function remove match which we created an island now in one off the latest part. What you can see in here I already commanded this one out was a particle f X affect. What we want to do is every time we find a hidden button, we want to get rid off and they imagine the temporary card i d. With all our last match ideas. We want to create particle facts directly where these objects are going to be. And that's pretty easily done off course. We just called instant. She ate open close friend to seize and inside. At first we need to declare What, are we insane? she ating In this case, it's our affects. Explosion next one is going to be a little bit more complicated since we need to do some mathematic calculation. The position is hidden in button list inscribe rickets I And since hidden button, this contains game objects where our cards are currently in. We say don't transform, don't position But we know instant she ate Every time we find a last match i d. We instance she ate Africa explosion at that pound gain object, which is the card. And what we also want to do is we want to say we want to have 1/4 earning don't identity, which is a rotation. We are saving what we have saved already in the Prefect. So we don't change the rotation at all. We could also use on transform dot rotating, but actually court. Earning that identity makes more sense at this point. Okay, but I will show you, and you will see in just a moment that this is not enough. And we need to take care of this one in just a second. Um, according Teoh. Yeah, the next steps. What we need to do now is since we already prepared the Candace. We know that we are insane. She ating them somewhere where the cards currently are. Also, we're going to to demote and checking our camera. Now you can see there is a distance between the camera which is over here and our this play . But what we also know is that it is hard for the current to render stuff which is directly on the same, um, let's say distance or on the same position as a cart. So for now, let's test out what's happening. And I are gonna pause when we are actually having a match. And we're instance Jiating those pieces, those particle systems. Well, now we goto a prefects will open the card manager and drag affects explosion into the empty slot in here. Otherwise we might get in, I reference. And don't forget to apply the changes to the prefab. Now we can't actually just don't and press play. So let's not try to find a match. And that's instant E 81 off those particle systems. Okay, what you can see now I have just stopped or paused. You can see in the game are in the senior in here the particles get instant created or at the current position, the cart position and center. But the point is, we're not seeing those in the game. You. Why is that so basically they're still a render crew up with ST where the I'm particle. Thanks. I rendered before the canvas. When I now put e porticos hex near on a or more to the camera itself, you can see them in the game us Bill. So what we need to do is we need to put them away one, maybe unit, or at least a little amount from the card itself into the Zad. Access as you can see into the that access more to the camera. So we have the possibility to see them in the game view as well. That's what we're gonna do now. We go back to the card manager into the remove match function where we instance she ate and set the position off button. We just pass in an extra vector in here. So add a new director Serie and we can pass and basically anything on Azad exit 00 comma one. We can also get into and put in any other value but one is actually one unit on the sad access. Let's try that out. If that is wrong, we can always get into and I'm put in and new or is ah, different number in here and also happened that we need to put in a negative value. So we need to figure this out and we checked. Now, what's going on? There are our explosions and they are behind now behind the canvas. Don't want we need to do us. We need to put in a negative Number one Don't forget to save. And now we should be able to see the particle thanked also in the game. You when we're having a match. Well, let's find one. Boom! Did you see that? I believe so That now they got instant. Gee, did we gonna get some effect with that particle system? So the plan knows. Okay, I had a match. This just has been in extra match in this case. By the way, that might be one thing. You have noticed that the colors off the cards are going to become changed. That means, if press colored and displayed or this April color in this case, getting bit grayed out. Maybe you want to go on to the disabled color and increase the kind of to be full white as well. So you don't have these, um, actually darkened or grade out carts when you have or when you're hitting a match. So let's try that whoop. It gets inst enshi ated. And after that, those cards I'm applicable, as has been done before. But at the same time, we gonna have that little particle fact working for us in the next part. We will take care off the card. So instead of keeping them open, we are also able to just yeah, believe them from the playfield if we like to. 9. #9 Additional Hide Matching Cards: in this part. I want to show you how to and get rid off the cards when you actually don't want to see them. The mechanics, they're going to stay the same with just add one more line of code when we basically have a match that we're not seeing those particular cards any more on the pay field. So the player actually might not get be distracted by our cards. We already have open. If you want to empty out those cards, there might be several possibilities. You can't sink off. I'm going to show you one, and I will show you why this is not happening or not working. I made a little command in here already, which is called Remove Visible. That means I would just want to visualize stuff for you. And is this going to happen inside? Remove match as well. So at the last port, we just created the particle fact and instead initiated our affects explosions and and before we actually removing this from from the hidden button list, we want to make sure that we make them anyhow, getting rid off the first thing you might get into. Okay, let's just destroy the cart. Maybe there's going toe working. So what do we want to destroy? Off course. We want to destroy the game object we already have inside the button. This. And after that, we gonna delete the entry from the hidden but list. So in this case, the most makes sense or year maybe is okay. We could try destroy the hidden button list. Game object. We're gonna sink the script. No. When I show you what's happening now, when we you try to destroy that and I will explain what's happening. Meanwhile, don't let's find a match pretty quick. So we're gonna have those two strawberries in here. And what you can't see now is the currents are going to get rolled up to the left top. That means we're gonna destroy them. But also, we destroy the functionality off our canvas system. Basically, we're gonna have our space a game. Objects for all your cards are in. But since we want to keep remembering where the cards are in, this is not a good choice than tha Carter. Not anymore here. And all the cards are now. Well, yeah. Rode up to the top left corner. We don't know what is on these cards, which have come up now as a player. So the second possible, if you think of okay, kind of destroyed, maybe can just disable the game objects off those particular cards. So let's try this one. Maybe this is going to happen or work better. So we say getting loving this in Scrabble J once again and we just set said, Active to be false. Let's see what's happening when we try this approach. No, we start this once again. The game would work the same. We didn't do anything. But we want to justice able to gain object. So let's try that. The same problem happens as you can see those two game objects. Those two currents are now disabled and there are not inside the space or basically not inside the group player group that the grid is now well obsolete once again because we don't know what's happening with the cards because they have been here, though we need to re sync everything and play and does not know how the new currents are going to be, you have placed once again. So what is the right way now? Well, basically all the cards. That's look at them. Those cards have several components on. For example, we gonna have an image component. What could we dio? We have a button component, which we just said indirect herbal toe before, so we're not able to set anything at all. And of course we have our card script itself, which we could basically talk to and do something with it. So several possibilities are actually possible. So we could go, for example, go directly, which is basically the easiest one. We could go to the image component and just disable the image. So this card is not seen anymore. It will just become invisible. But at the same time, the functionality, because the card is still in active game objects, still has the size and everything is not changed. Let's try this. We could now. Well, we will now say we want it once again. Hidden button This inscribe tickets. I and now what? We want to do it. I want to get a component on that particular cart, and this card is off type image. But as you can see, image is not available since this requires the name Spain's unity and in W I so we could do two things. Now we can implement the names based directly in the top. But also, we have the possibility to put the name space directly inside the image call. We just need to make sure that we don't have any typos. In this case, it's unity engine, don't you? Why was biggie letters? And then we say dot image and images part off the you I name space in Unity engine open close Prentice E at the end. And now we can take a call, for example, we can just say are enabled equals false. That was Just disable the image component on the cart We're currently looping through which have been our matches. Don't forget to save and let's go back to unity and see what's happening in here. We play now, and once compilers running and everything is going on in here, we're gonna find or try to find a match. And, um, there we go. We still have the position off the currents. We have taken off. We can go and check what's going on with the image component. As you can see, the image just became disabled. It has this particular image on here. What we just Yeah, make sure that this is going to be disabled as it continues to open its still there. But we just disable the visibility off that particular image, and that's what we need. Also were not able to put this one anymore because well, yet this button is not interacting anymore and intractable anymore. And this is the reason why this is basically the best possibilities. We could happen here. The the next one is we can open the rest off the playfield once again. Those through all the cards and see and remember away all that stuff is going to be all the other counts were full of the same rules and boom we just want and we can now try is restarting no still functioning because all the image components are basically empty. Well, yes, because all the game objects all the cards are re instant created. And, as you can see, that have been once again. Um, yeah, recreated. And the complete Plainfield is now playable once again and the functionality is gone back to life. And that's it. When I wanted to show you in this little part