 Howdy guys, IndiePixel here and in this series of videos I wanted to show a tool that I built a while back and the reason why I built this particular tool is because I was tired of having to set up my project folder structure over and over and over again and try to keep it consistent between all the projects and really trying to maintain a consistency between your Unity projects. It's a good thing because then when you're going back and forth between lots of different games that you're developing or applications that you're developing the project folders are the same so it's a lot faster and easier to find things and so basically I have this a little framework here that I've been you know building over the years and it includes just a lot of tools and code and stuff like that that I use over and over and over again and what I wanted to show though was the project helper script so in this video we're going to rebuild this particular script in this script what it does is it allows us to go and create the project folders for a new Unity game so in this instance if I have a new project that I'm working on I open up a fresh new Unity project here and then I import the IndiePixel framework and then I just go and set up the folder structures for that particular project by typing in the the name of the project and then hitting create folder structure and what that does is it creates a project folder structure that I've been using a lot over the last few years and it's really useful and efficient and it keeps everything organized and now that I have the tool all my Unity projects share the same setup so it's very very beneficial to start to get into the habit of writing these little utilities that just speed up your workflow so let's go and actually build this so you guys can see how it works so what I'm going to do is create a new folder and I'm just going to call this something like my tools for now you can call it whatever but it's a good idea to store all your tools inside of some sort of parent root directory and then I'm going to go create another folder and call this the project setup tool like so and inside of this particular folder I'm going to create that new script and what I need to do is actually put this all inside of an editor folder so the editor tool will actually work so we'll do editor and then we'll actually nest this guy inside of there like so so now that'll completely work so what I need to make this fully functional is two scripts so the first script is going to be a C sharp script and I'm just going to call this project setup window all right and then I'm going to make another script outside of that particular folder and I'm just going to call this not a new folder sorry I want a new script so we'll create a new C sharp script and we'll just call this editor menus for now okay so what I want to do is pop those two guys open so I'm just going to launch the window script first and then launch the editor menus script and my goal right now is to just get an editor window up and rolling so if you're new to editor tools this will probably be you know interesting to you if you know how to do it then awesome so what I want to do here is get rid of the start and update functions because we won't need those and this doesn't need to be a minor behavior because all we're going to do with this particular script is house all the menus that we create so I also need to make sure that I'm using the Unity editor namespace all right so let's hop back into Unity over here so all these menus are stored in a single script at least that's how I've gone and architected the IndiePixel framework right and that that just makes it easy for me to go and find where all the menus are for all these particular editor tools that I have so that's why I do that if you're wondering so the first thing I want to do is create a new menu item and this menu item is going to live anywhere you want really if you are posting on the asset store you have to put it in one of the existing I believe it's still the rule one of the existing menus but I'll just I'll just create another menu because this is only for my consumption not for the asset store so I'm just going to call this my tools and we will say projects and then we'll call this the project setup tool and this will allow me then to create a static function here that gets called when this particular menu item is clicked on so we'll say init project setup tool all right so I also need to put in the parentheses there we go all right so now we can go back to unity over here and we should get a menu up here called my tools and project project setup tool so you can we can verify that that works by just putting in like a debug dialogue we'll say launching project setup tool all right so now in the console we should get a log there we go cool so that's all working so let's go and set up the project set up window so we can actually see it so again I'm going to need the unity editor namespace because we're creating editor tools and what I like to do is put these all of my tools inside of a namespace so you can see here I have the other scripts open and I basically have them under a namespace and the reason why I do this is it so it doesn't clash with any other classes that are in another namespace this way I can use all my own names and stuff like that it does help you keep your code organized as well so I'm just going to call this the my tools namespace I know that's not very descriptive but you know for the video's sake it'll work for now and I want to put the menus under that same namespace cool all right so we're getting things built up so let's go and get the window actually rolling so in order to do this we need to make it extend or inherit from the editor window class that we get all that functionality and then what I'm going to do is set up some regions so just do that and I just do that for my own organizational reasons helps me see the code faster and then what I'm going to do is set up a static variable that is of type project setup window all right and we'll just call this the the win now you don't have to do that but it'll give you access if you start building a lot of other tools you could shut down other windows you know from other tools if you can grab the static instance here all right so what we need to do now is create a public static void init window method and the reason why we're doing this is because now we can call this because it's public and it's static all right we can call this from this particular menu item now so I can say project setup window dot init window all right and we're almost there we'll almost get a window actually created so in order to do that what we want to do is we want to say that the win is equal to an editor window dot get window and the type is going to be the project setup window and you can see that we have a bunch of options in here all right so what I'm going to do is I'm just going to use the title for now and I'm just going to call this project setup so this is going to be the string that you see at the top of the the window gives you a little bit more information about what that particular window is doing and then finally we just need to say win dot show all right so we get the static instance right here and we show the window and that'll actually get a window popped up but if we wanted to place some UI in it we need to do the void on GUI method and in this what we could do is you know for now while we're testing this out is actually just do an editor GUI to layout dot label all right and we could just say project setup something like that cool that'll just give us something to see so let's see if everything worked out all right no error so let's go project project setup tool and voila we have a window all right so there's lots of things you can do at this point um but we're going to just focus on obviously setting up our project folders so we're going to walk through and learn how to create directories and add new files to it just really get a project setup you know at its bare bones that way all your projects have a consistency level that makes things easier more efficient all right so I'm going to leave this video at this point and in the next video we're going to start to get some functionality hooked up so we can start creating some folders thanks so much