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
iOS与Android平台都可以使用这个目录下进行读写操作,可以存放各种配置文件进行修改之类的。
在PC上的地址是:C:\Users\用户名 \AppData\LocalLow\DefaultCompany\test
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)
网络播放器:到播放器数据文件夹的绝对路径(没有实际的数据文件名称)
#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
iOS与Android平台都可以使用这个目录下进行读写操作,可以存放各种配置文件进行修改之类的。
在PC上的地址是:C:\Users\用户名 \AppData\LocalLow\DefaultCompany\test
Application.dataPath : 数据路径
Unity Editor: <path tp project folder>/AssetsUnity 编辑器:<工程文件夹的路径>/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)
网络播放器:到播放器数据文件夹的绝对路径(没有实际的数据文件名称)
相关文章推荐
- Unity UGUI —— 无限循环List(转载)
- 安卓分享纯图片
- Android中Recyclerview使用6----添加条目得到点击事件和长按事件(另一种写法,较简单)
- iOS8 定位当前城市
- Android ListView 隐藏自带分割线
- android--xUtils开发框架
- native app 集成 cocos-2dx-js 3.11 (Android篇)
- Error running app: Instant Run requires 'Tools | Android | Enable ADB integration' to be enabled.
- Android逆向分析案例——某地图的定位请求分析
- Android中定时器Timer和TimerTask的启动,停止,暂停,继续等操作实例
- GreenDao_2.介绍GreenDao
- 推荐几款实用的Android Studio 插件
- Android开发将List转化为JsonArray和JsonObject
- Swift解包拆包方式
- CABasicAnimation 使用
- android simpledraweeview 获取已经加载的图片bitmap
- webView与js交互——获取通讯录手机号并显示运营商
- Android listview 点击问题
- 初识Android之(一)-自定义标题栏控件
- 简单总结Unity使用AssetDatabase编辑器资源管理