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
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);
|
|
}
|
|
}
|