Version: 2019.4
public static string dataPath ;

説明

Contains the path to the game data folder on the target device (Read Only).

値は実行しているプラットフォームによって異なります。

Unity Editor: <path to project folder>/Assets

Mac プレイヤー: <path to player app bundle>/Contents

iOS プレイヤー: <path to player app bundle>/<AppName.app>/Data (このフォルダーは読み込み専用で Application.persistentDataPath を使用してデータを保存します。)

Win/Linux player: <path to executablename_ Data folder> (ほとんどの Linux では大文字と小文字は区別されるので注意してください。)

WebGL: 再生プレイヤーのデータが含まれているフォルダーの絶対パス (URL には実際のデータファイル名は含まれずフォルダー名までです)

Android: Normally it points directly to the APK. If you are running a split binary build, it points to the OBB instead.

Windows Store Apps: The absolute path to the player data folder (this folder is read only, use Application.persistentDataPath to save data)

PC 上で返される文字列はフォルダーの区切りとしてスラッシュを使用することに注意してください。

For any unlisted platform, run the example script on the target platform to find the dataPath location in the debug log.

//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); } }