社区
Unity3D
帖子详情
Unity导出PC端报错
mzhangzt
2017-06-20 03:06:15
Unity游戏导出PC报的错,怎么导出的时候一起把资源也导出来,不然他们报找不见资源的错
...全文
2130
6
打赏
收藏
Unity导出PC端报错
Unity游戏导出PC报的错,怎么导出的时候一起把资源也导出来,不然他们报找不见资源的错
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
6 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
tianmao111
2017-07-30
打赏
举报
回复
pc下,不应该带file//吧,路径要动态获取
mzhangzt
2017-07-11
打赏
举报
回复
我改成这样
public static readonly string LevelDir ="file//"+Application.streamingAssetsPath + @"/Levels";
string[] files = Directory.GetFiles(Consts.LevelDir, "*.xml");
运行到PC端报这个错了
但是这个文件夹也在
加载这个XML文件是这样加载的
tianmao111
2017-07-07
打赏
举报
回复
#if UNITY_EDITOR #if WWW string t_path = "file:///" + Application.streamingAssetsPath + "/"; #elif IO string t_path = Application.streamingAssetsPath + "/"; #endif #elif UNITY_STANDALONE_WIN string t_path = Application.streamingAssetsPath + "/"; #elif UNITY_IPHONE string t_path = Application.dataPath + "/Raw/"; #elif UNITY_ANDROID string t_path = "jar:file://"+Application.dataPath + "!/assets/"; #endif return t_path; }
tianmao111
2017-07-07
打赏
举报
回复
这要看你是通过什么方式读取这个路径的了,编辑器下和发布到PC下的路径不一样,路径前边要带file://
无名剑
2017-07-03
打赏
举报
回复
日志已经说得很直白了,就是找不到文件路径 你看下磁盘上有没有对应的
文件夹
mzhangzt
2017-06-24
打赏
举报
回复
我是这样加载文件夹的
//得到LevelDir目录下所有.xml文件的数据
string[] files = Directory.GetFiles(Consts.LevelDir, "*.xml");
在Consts类中定义文件路径
public static readonly string LevelDir = Application.dataPath + @"/Game/Resources/Res/Levels";
结果在Unity中运行没任何问题,导入PC就报这样的错
Unity
导exe带
报错
日志
Unity
导exe带
报错
日志
Unity
导出
exe
报错
,
PC端
程序连接mysql数据库
导出
到
PC端
时报下列错误: 错误一: ArgumentException: The Assembly System.Configuration is referenced by System.Data. But the dll is not allowed to be included or could not be found. 错误二:
Unity
Editor.BuildPlayerWindow+BuildMethodException: 3 errors 错误三:
unity
发布为 PC版本后
报错
为:codepage 936 not supported
一直检查不出来是什么问题,经查阅资料通过两步解决:一、https://www.cnblogs.com/zhuweisky/p/3145130.html二、https://www.cnblogs.com/cqgreen/p/4101599.html具体为:(1)生成时 player setting 中 这样设置(2)最近在开发中要用到GB2312字符编码(CP936),在C#代码中便有了如此代码1 ...
Unity
WebRequest.Post
报错
Unity
WebRequest.Post(string uri, string postData) 这个方法在内部会先进行 URL 编码,进行请求时会
报错
,解决方法
unity
导出
pc端
后读取xml
报错
C# 读取xml的方法有很多,最简单的方法可能就是通过xmldocument.load来读取。 XmlDocument doc = new XmlDocument(); doc.Load(Application.dataPath + @"Resources/xx.xml"); 在editor下运行没事,
导出
pc后就一直读不出来,原因其实就是
导出
后,resources资源被整合在一起了...
Unity3D
2,535
社区成员
2,141
社区内容
发帖
与我相关
我的任务
Unity3D
Unity3D相关内容讨论专区
复制链接
扫一扫
分享
社区描述
Unity3D相关内容讨论专区
游戏
unity
技术论坛(原bbs)
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
Unity3D社区公告:
社区致力于解决各种Unity3D相关的“疑难杂症”。
社区不允许发布与Unity3D或相关技术无关内容。
社区版主邀请各位一道为打造优秀社区不懈努力。
试试用AI创作助手写篇文章吧
+ 用AI写文章