But here we're using it for our screenshot utility.
Another thing that we're doing in Awake is we're determining
if the directory screenshots currently exist within our project folder.
And if it doesn't, then we're actually creating that directory.
So you can use the system.io classes to for example create directories.
Download an update, we're checking to see if the key is pressed and if the key is
pressed ultimately we are going to call Application.CaptureScreenshot
this is what does the magic of actually capturing the screenshot of course.
The first argument we specify the location and file name.
So you can see that we are saving within the Screenshot folder.
And the file name is gonna be in the format Screenshot_WIDTHxHEIGHT_ and
then the current count number.
Which of course starts at one, two, three and so forth.
The second argument is the scale factor.
The scale factor basically defines how much we're going to scale up
from the current screen size.
So with the scale factor of one, it will be a direct pixel to pixel screen shot.
If we scale up to something like two, it's going to double the width and
height of the screenshot.
You know and we could even scale up to something like four to grab
a much higher resolution screen shot that we might use for print purposes,
like printing a game poster.
So let me go back to Unity and we've got our game objects set up.
And if I go ahead, let me uncheck maximize on play, and
just demo this, don't destroy on load.
So if I press play, we'll be on the loading screen,
and then we move to the Main Menu.
You can see the screenshot utility still exists.
If I click New Game, you can see the screenshot utility continues to exist
across all those scenes, even though it was only created in the loading scene.
So, the next that I wanna do is make sure that I'm on the right target platform for
screenshots that I wanna create.
So under File > Build Settings,
I'm currently on the web player which is actually what I want.
If you're following along feel free to select web player in switch platform.
So with the web player targeted under the game view
we can specify the size of our screen.
So currently mine is on four by three aspect ratio.
It's not on a defined pixel size but
you can see actually there's a defined pixel size down here.
960 by 600.
So, let me go ahead and pick this.