SW 중심대학 OSS GIT 서버 박건태, 이승준, 고기완, 이준호 새로운 배포
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

24 lines
692 B

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class TakeScreenshot : MonoBehaviour
{
[SerializeField]
GameObject blink;
// Start is called before the first frame update
public void TakeAshot()
{
StartCoroutine("Shot");
}
IEnumerator Shot()
{
string timeStamp = System.DateTime.Now.ToString("MM-dd-yyyy-HH-mm-ss");
string fileName = "하위" +"_"+ timeStamp + ".png";
string pathToSave = fileName;
ScreenCapture.CaptureScreenshot(pathToSave);
yield return new WaitForEndOfFrame();
Instantiate(blink, new Vector2(0f, 0f), Quaternion.identity);
}
}