Application中的路径
前提条件
项目工程目录:E:/Work/cosmosbox/cb-client/
我电脑当前的用户名:qingqing
PersistentDataPath
Application.persistentDataPath 持久数据路径,APP更新时不会删除此数据 例:C:/Users/qingqing/AppData/LocalLow/Cosmosbox/
最后一位的目录名为PlayerSettings中设置的CompanyName
在Windows平台可能因为用户名为非英文字条而出现其它麻烦,可以设置为 xxx/Library/UnityWinPersistentDataPath
public static string GetAppDataPath()
{
// Windows 时使用特定的目录,避免中文User的存在
if (Application.platform == RuntimePlatform.WindowsEditor || Application.platform == RuntimePlatform.WindowsPlayer || Application.platform == RuntimePlatform.WindowsWebPlayer)
{
string dataPath = Application.dataPath + "/../Library/UnityWinPersistentDataPath";
if (!Directory.Exists(dataPath))
Directory.CreateDirectory(dataPath);
return dataPath;
} return Application.persistentDataPath;
}
文档:http://wiki.ceeger.com/script:unityengine:classes:application:application.persistentdatapath
dataPath
Application.dataPath 数据路径(Assets目录) 例:E:/Work/cosmosbox/cb-client/Assets
详细:http://wiki.ceeger.com/script:unityengine:classes:application:application.datapath?s[]=application
streamingAssetsPath
Application.streamingAssetsPath (Assets/StreamingAssets目录),AssetBundle一般存放在此目录下,可以通过www读取 例:E:/Work/cosmosbox/cb-client/Assets/StreamingAssets
Android:jar:file://+Application.dataPath+string.Format("!/assets/{0}/", ResourceDirName)
Unity Editor:file:///
文档:http://wiki.ceeger.com/script:unityengine:classes:application:application.streamingassetspath
temporaryCachePath
Application.temporaryCachePath 操作系统的临时缓存目录 ,例: Z:/TEMP/Cosmosbox/ [我的电脑把缓存文件设置在Z盘]
最新文章
- openfl使用64位的ndk时,编译报错的问题!
- redis安装
- Themida和Winlicense加壳软件脱壳教程
- cocos2d_x 问题汇总
- Javascript 迭代法实现数组多条件排序
- COJ 1007 WZJ的数据结构(七) 树上操作
- Lucene总结
- 阿里云消息队列(MQ)服务
- 距离不是一个连续的物理量(Distance is not a continuous physical quantity)
- Android-Could not find method implementation() for arguments
- ios开发之--复制到剪切板
- 【bzoj4337】【Bjoi2015】树的同构
- sql中多层循环示例(有游标)
- SOLARIS 11G 安装 ORACLE 11G
- Linux ssh开启服务
- 20145216史婧瑶《Java程序设计》第一次实验报告
- JAVA类的加载、连接与初始化
- Proxmox VE 设置备忘
- jar包上传到jcenter
- Java使用UDP聊天程序
热门文章
- svn服务端和eclipse配合使用
- Arcgis Engine 切割图斑(ITool)
- Windows下安装scikit-learn
- Client JQuery invoke NetSuite Suitelet
- 不直接登录SharePoint服务器,通过远程直接部署WSP解决方案包
- [Android]解决ClickableSpan中点击后ListView中item的长按冲突的问题
- CoreData的使用
- CocoaPods的安装和使用那些事(Xcode 7.2,iOS 9.2,Swift)
- drawable以及Bitmap的基本操作
- 实现如下类之间的继承关系,并编写Music类来测试这些类。