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