您的位置:首页 > 移动开发

Application路径

2016-07-19 14:48 288 查看
根目录:StreamingAssets文件夹

#if UNITY_EDITOR

string filepath = Application.dataPath +"/StreamingAssets"+"/my.xml";

#elif UNITY_IPHONE

string filepath = Application.dataPath +"/Raw"+"/my.xml";

#elif UNITY_ANDROID

string filepath = "jar:file://" + Application.dataPath + "!/assets/"+"/my.xml;

#endif

根目录:Resources 文件夹

可以使用Resources.Load("名字"); 把文件夹中的对象加载出来

根目录:StreamingAssets 文件夹

可以使用Application.dataPath进行读操作

Application.dataPath: 只可读不可写,放置一些资源数据

Application.persistentDataPath

iOSAndroid平台都可以使用这个目录下进行读写操作,可以存放各种配置文件进行修改之类的。

在PC上的地址是:C:\Users\用户名 \AppData\LocalLow\DefaultCompany\test


Application.dataPath : 数据路径

Unity Editor: <path tp project folder>/Assets

Unity 编辑器:<工程文件夹的路径>/Assets

Mac player: <path to player app bundle>/Contents

Mac播放器:<到播放器应用的路径>/Contents

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

iPhone播放器:<到播放器应用的路径>/<AppName.app>/Data

Win player: <path to executablename_Data folder>

Win播放器:< 包含可执行播发器的文件夹的路径>\Data

Dashboard widget: <path to the dashboard widget bundle>

Dasboard窗口:< dashboard widget bundle的路径>

Web player: The absolute url to the player data file folder (without
the actual data file name)

网络播放器:到播放器数据文件夹的绝对路径(没有实际的数据文件名称)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: