유니티에서 프로모션용 고해상도 스크린샷찍기

매번 그냥 스크린캡처키로 캡처하거나

 

https://assetstore.unity.com/packages/tools/instant-screenshot-24122?locale=ko-KR

 

Instant Screenshot - Asset Store

This editor extension allows you to take a high-resolution screenshot of your game right from the game view as well as the scene view! You can now get super high-resolution renders of your game with a click of the button (with/without transparent backgroun

assetstore.unity.com

에셋을 사용했었는데, 위의 에셋은 투명한 배경으로 찍고 싶거나할 때 정말 유용하다.

장점이자 단점은 UI가 컬링 되버린다는 것.

 

 

근데 프로모션용은 게임의 스크린샷을 찍어야하는거라 유아이가 컬링되면 안된다.

그래서 잠깐 찾아봤는데 그냥 ScreenCapture.CaptureScreenShot 하면 되는 거였다.

경로는 따로 지정하지않으면 프로젝트 경로 최상단에 저장된다.

 

using System;
using UnityEngine;

public class ScreenShot : MonoBehaviour
{
    #if UNITY_EDITOR
    private void Update()
    {
        if (Input.GetKeyDown(KeyCode.M))
        {
            ScreenCapture.CaptureScreenshot("ScreenShot" + DateTime.Now.Second + DateTime.Now.Millisecond + ".png");
            Debug.Log("스크린샷저장");
        }
    }
    #endif
}

 

 

 

 

댓글

Designed by JB FACTORY