Unity3d游戏无法部署到windows phone8手机上的解决方法
来源:互联网 发布:pdf语音软件 编辑:程序博客网 时间:2024/05/16 01:35
今天搞了个unity3d游戏,准备部署到自己的lumia 920上,数据线连接正常,操作正常,但是“build”以后,始终无法部署到手机上,也没有在选择的目录下生产任何相关文件。(你的系统必须是win8)
但是提示有一个错误:
Error building Player: Exception: Error: method `System.Byte[] System.IO.File::ReadAllBytes(System.String)` doesn't exist in target framework. It is referenced from Assembly-CSharp.dll at System.Byte[] NGUITools::Load(System.String).
意思是NGUITools.cs里面的Load()方法有问题,导致无法部署。
解决方案:找到NGUITools.cs,找到Load()方法。代码如下:
?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/// <summary>
/// Load all binary data from the specified file.
/// </summary>
static
public
byte
[] Load (
string
fileName)
{
#if UNITY_WEBPLAYER || UNITY_FLASH
return
null
;
#else
if
(!NGUITools.fileAccess)
return
null
;
string
path = Application.persistentDataPath +
"/"
+ fileName;
if
(File.Exists(path))
{
return
File.ReadAllBytes(path);
}
return
null
;
#endif
}
只要在#if UNITY_WEBPLAYER || UNITY_FLASH后面加个“UNITY_WP8”就可以了。
完整代码:
?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/// <summary>
/// Load all binary data from the specified file.
/// </summary>
static
public
byte
[] Load (
string
fileName)
{
#if UNITY_WEBPLAYER || UNITY_FLASH||UNITY_WP8
return
null
;
#else
if
(!NGUITools.fileAccess)
return
null
;
string
path = Application.persistentDataPath +
"/"
+ fileName;
if
(File.Exists(path))
{
return
File.ReadAllBytes(path);
}
return
null
;
#endif
}
之后,按照部署步骤,Build以后就可以看到游戏安装到手机上了。
参考资料:
http://www.tasharen.com/forum/index.php?topic=6625.0
unity3d部署到wp手机:
http://game.ceeger.com/Manual/wp8-deployment.html
阅读全文
0 0
- Unity3d游戏无法部署到windows phone8手机上的解决方法
- 从WINDOWS PHONE8的发布看游戏开发的未来
- Eclipse无法检测到手机的解决方法
- Windows Phone8.1虚拟机无法启动
- 用VS2010+cocos2d-x 2.0.3编写游戏,并将游戏部署到Android手机上
- Windows phone8
- android eclipse无法检测到手机的解决方法
- [windows phone8使用技巧]windows phone8无法上网解决办法[3G]
- Windows Phone8图表Chart的实现
- 关于windows phone8.1的调用浏览器
- eclipse无法连接到插入电脑上的手机
- 升级到 WINDOWS XP SP3 后无法开机的解决方法
- Unity3D手机游戏开发的一些笔记
- Unity3D手机游戏开发
- Java游戏程序部署在不同平台的手机模拟器上
- Java游戏程序部署在不同平台的手机模拟器上
- Java游戏程序部署在不同平台的手机模拟器上
- Java游戏程序部署在不同平台的手机模拟器上
- django中HttpRequest对象
- Python之禅
- php实现斐波那契数列
- 数据库语句
- 文章目录
- Unity3d游戏无法部署到windows phone8手机上的解决方法
- JVM垃圾回收机制
- 机器学习技法课程学习笔记2 -- Dual Support Vector Machine
- SSM框架Spring+SpringMVC+MyBatis——详细整合教程
- 使用JavaScript实现制作动态时钟
- String和char的算法题
- 数据库基本操作
- Spring整合CXF发布基于SOAP协议的服务
- Unity3d发布错误:could not allocate memery:system out of memery!