Version: 2019.2
public static string dataPath ;


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

Значение зависит от того, на какой платформе вы работаете:

Редактор Unity: <path to project folder>/Assets

Mac: <path to player app bundle>/Contents

iPhone: <path to player app bundle>/<>/Data

Win: <path to executablename_Data folder>

Веб плеер: Абсолютная гиперссылка на папку с файлами данных игрока (без актуального имени файла данных)

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)

Обратите внимание, что строка, возвращенная на ПК будет использовать косую черту в качестве разделителя папок.

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