Captura Pantalla

You might also like

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

using System.

Collections;
using System.Collections.Generic;
using UnityEngine;

public class CapturaPantalla : MonoBehaviour


{
public string folder = "ScreenshotFolder";
void Awake()
{
DontDestroyOnLoad(transform.gameObject);
}
void Start()
{

// Create the folder


System.IO.Directory.CreateDirectory(folder);
}

void Update()
{
// Append filename to folder name (format is '0005 shot.png"')
string name = string.Format("{0}/{1:D04} shot.png", folder,
Time.frameCount);

// Capture the screenshot to the specified file.


if (Input.GetKeyDown("e"))
{
ScreenCapture.CaptureScreenshot(name);
}

}
}

You might also like