본문 바로가기
tips/자주쓰는 C# 스크립트

자주쓰는 Application 함수, 변수

by 디지털 수공업자 2021. 7. 3.
반응형

웹사이트 열기

Application.OpenURL("https://boxwitch.tistory.com") ;

// 결과 : 브라우저가 실행되고 URL이 열림.

 

앱 종료

Application.Quit() ;

//결과 : 앱 종료

 

앱이름

string name = Application.productName ;
// 읽기 전용

Debug.Log(name) ;
// 결과 : 앱 이름 출력

 

앱 버전

string version = Application.version ;
// 읽기 전용
Debug.Log(version) ;
// 결과 : 앱 버전 출력

 

앱 번들 식별자

string iden = Application.bundleIdentifier ;

// 읽기 전용

Debug.Log(iden) ;

// 결과 : 앱 번들 식별자 출력

 

스크린샷 저장

string filename = "path/shot.png" ;

Application.CaptureScreenshot(filename) ;

// 결과 : filename의 경로에 스크린샷을 찍어 저장, 같은 이름 파일이 존재하는 경우 덮어씀, WebPlayer에서는 작동안함, 모바일에서는 persistent data path에 파일이름을 추가하여 저장됨.

반응형

댓글