-
Application.dataPath
public static string dataPath;설명
대상 장치의 게임 데이터 폴더 경로 값(읽기 전용).
값은 실행 중인 플랫폼에 따라 다르다.
Unity 편집기: < 프로젝트 폴더 경로 >/Assets
Mac 플레이어: < 플레이어 앱 번들 경로 >/Contents
iOS 플레이어: < 플레이어 앱 번들 경로 >/< AppName.app > /Data(이 폴더는 읽기 전용이며 Application.persistentDataPath 를 사용 하여 데이터를 저장합니다).
Win/Linux 플레이어: < 실행 파일 이름_데이터 폴더 경로 > (대부분의 Linux 설치는 대소문자를 구분합니다!)
WebGL: 플레이어 데이터 파일 폴더의 절대 URL(실제 데이터 파일 이름 제외)
Android:일반적으로 APK를 직접 가리킵니다. 분할 바이너리 빌드를 실행하는 경우 대신 OBB를 가리킵니다.
Windows 스토어 앱: 플레이어 데이터 폴더의 절대 경로(이 폴더는 읽기 전용이며, Application.persistentDataPath 를 사용 하여 데이터를 저장합니다.)
PC에서 반환된 문자열은 폴더 구분 기호로 슬래시를 사용합니다.
나열되지 않은 플랫폼의 경우 대상 플랫폼에서 예제 스크립트를 실행하여 디버그 로그에서 dataPath 위치를 찾으십시오.//Attach this script to a GameObject //This script outputs the Application’s path to the Console //Run this on the target device to find the application data path for the platform using UnityEngine; public class Example : MonoBehaviour { string m_Path; void Start() { //Get the path of the Game data folder m_Path = Application.dataPath; //Output the Game data path to the console Debug.Log("dataPath : " + m_Path); } }
'Android' 카테고리의 다른 글
Chronometer (0) 2022.07.30 Jetpack (0) 2022.07.28 TextView (0) 2022.07.28 알림접근허용 (0) 2022.07.19 Volley (0) 2021.10.26 JSONObject (0) 2021.10.26 Android 삭제된 연락처 복원 (0) 2021.05.18 Android App 이름 (1) 2021.03.09