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

4 years ago
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class TakeScreenshot : MonoBehaviour
  5. {
  6. [SerializeField]
  7. GameObject blink;
  8. // Start is called before the first frame update
  9. public void TakeAshot()
  10. {
  11. StartCoroutine("Shot");
  12. }
  13. IEnumerator Shot()
  14. {
  15. string timeStamp = System.DateTime.Now.ToString("MM-dd-yyyy-HH-mm-ss");
  16. string fileName = "하위" +"_"+ timeStamp + ".png";
  17. string pathToSave = fileName;
  18. ScreenCapture.CaptureScreenshot(pathToSave);
  19. yield return new WaitForEndOfFrame();
  20. Instantiate(blink, new Vector2(0f, 0f), Quaternion.identity);
  21. }
  22. }