본문 바로가기
개발/C#

유니티 C# 화면 캡처하기 간단 구현 Screen Capture

by SPNK 2023. 4. 1.
반응형
  • 코드 작성
using UnityEngine;
using System.Collections;
using System.IO;

public class ScreenCapture : MonoBehaviour
{
    public string fileName = "screenshot.png";

    void Update()
    {
        if (Input.GetKeyDown(KeyCode.C))
        {
            string filePath = Path.Combine(Application.dataPath, fileName);
            ScreenCapture.CaptureScreenshot(filePath);
            Debug.Log("Screenshot saved to: " + filePath);
        }
    }
}
반응형

댓글