public static string dataPath ;

Description

Содержит путь к папке игровых данных (Read Only).

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

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

Mac: <path to player app bundle>/Contents

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

Win: <path to executablename_Data folder>

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

Android: Normally it would point directly to the APK. The exception is if you are running a split binary build in which case it points to the 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)

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

//Attach this script to a GameObject
//This script outputs the Application’s path to the Console
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("Path : " + m_Path); } }
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961