ios语音输入崩溃
游戏中任何可以输入的地方,只要调用语音输入,必然会导致app崩溃,解决方法如下:
ok, so essentially the gist of it is that siri wants gl context and to be rendered alongside your view. So you need to play nice with it.
first of all in Classes/Unity/EAGLContextHelper.h
add forward declaration for
struct UnityDisplaySurfaceBase;
and then inside class EAGLContextSetCurrentAutoRestore add constructor:
EAGLContextSetCurrentAutoRestore(UnityDisplaySurfaceBase* surface);
so it looks like that
struct UnityDisplaySurfaceBase;
<...>
class
EAGLContextSetCurrentAutoRestore
{
public:
EAGLContext* old;
EAGLContext* cur; EAGLContextSetCurrentAutoRestore(EAGLContext* cur);
EAGLContextSetCurrentAutoRestore(UnityDisplaySurfaceBase* surface);
~EAGLContextSetCurrentAutoRestore();
};
then in Classes/Unity/EAGLContextHelper.mm
add
#include "UnityRendering.h"
and implementation for new ctor
EAGLContextSetCurrentAutoRestore::EAGLContextSetCurrentAutoRestore(UnityDisplaySurfaceBase* surface)
: old(surface->api == apiMetal ? nil : [EAGLContext currentContext]),
cur(surface->api == apiMetal ? nil : ((UnityDisplaySurfaceGLES*)surface)->context)
{
if (old != cur)
[EAGLContext setCurrentContext:cur];
}
Afterwards you just need to go to Classes/UnityAppController+Rendering.mm and add
EAGLContextSetCurrentAutoRestore autorestore(GetMainDisplaySurface());
to
static void UnityRepaintImpl(bool forced)
so it looks like this
static void UnityRepaintImpl(bool forced)
{
@autoreleasepool
{
EAGLContextSetCurrentAutoRestore autorestore(GetMainDisplaySurface()); Profiler_FrameStart();
<...>
again, i cannot even build 4.x now, so you need to use c/objc knowledge to fix possible compilation errors (if i forgot to mention some incudes or smth)
参考自:http://forum.unity3d.com/threads/dictation-siri-keyboard-crash.358123/
ios语音输入崩溃的更多相关文章
- 使用OLAMISDK实现一个语音输入数字进行24点计算的iOS程序
前言 在目前的软件应用中,输入方式还是以文字输入方式为主,但是语音输入的方式目前应用的越来越广泛.这是一个利用 Olami SDK 编写的一个24点iOS程序,是通过语音进行输入. Olami SDK ...
- iOS textField输入金额的限制,小数点前9位,后面两位
iOS textField输入金额的限制,小数点前9位,后面两位,如果不加小数点,最大位数是9位,加上小数点,最大位数是12位,超出最大位数可删除 - (BOOL)textField:(UITextF ...
- iOS系统app崩溃日志手动符号化
iOS系统app崩溃日志手动符号化步骤: 1.在桌面建立一个crash文件夹,将symbolicatecrash工具..crash文件..dSYM文件放到该文件夹中 a.如何查询symbolicate ...
- HoloLens开发手记 - Unity之语音输入
对于HoloLens,语音输入是三大基本输入方式之一,广泛地运用在各种交互中.HoloLens上语音输入有三种形式,分别是: 语音命令 Voice Command 听写 Diction 语法识别 Gr ...
- 【译】理解与分析ios应用的崩溃报告
源网址: http://developer.apple.com/library/ios/#technotes/tn2151/_index.html 当一个应用程序崩溃时,创建一份“崩溃报告”对于理解崩 ...
- 经典好文:android和iOS平台的崩溃捕获和收集
通过崩溃捕获和收集,可以收集到已发布应用(游戏)的异常,以便开发人员发现和修改bug,对于提高软件质量有着极大的帮助.本文介绍了iOS和android平台下崩溃捕获和收集的原理及步骤,不过如果是个人开 ...
- iOS TextView输入长度限制 设置placeholder
textView在使用中通常会有2个功能是最常用的 设置placeholder 限制输入长度 TYLimitedTextView刚好是为了解决这个2个问题而诞生的,下面讲解TYLimitedTextV ...
- AngularJS进阶(十八)在AngularJS应用中集成科大讯飞语音输入功能
在AngularJS应用中集成科大讯飞语音输入功能 注:请点击此处进行充电! 前言 根据项目需求,需要在首页搜索框中添加语音输入功能,考虑到科大讯飞语音业务的强大能力,遂决定使用科大讯飞语音输入第三方 ...
- HTML5语音输入方法
谷歌的网站是时逛时新啊,今天在他们首页发现了HTML5的新玩法——语音搜索.可惜的是只有webkit核心的浏览器才能使用.用法很简单只需要在input添加属性 x-webkit-speech 即可,例 ...
随机推荐
- select2插件不兼容ie7,ie7下样子显示错位问题
1.源文件(未修改) select2.min.css.select2.min.js 2.ie7下显示样式: 3.ie8下显示样式: 4.经查看发现ie7下对一些属性的解析和ie8不同,需对ie7另作h ...
- axis2开发webservice程序
一.环境 eclipse + jdk 6.0 + win7 64位 +tomcat7.0 二.创建服务端程序 1.新建web项目,webserviceTest 2.下载axis2,将lib目录下的ja ...
- git回滚错误提交
git log //找到你要回滚的那次提交 比如:43596f6b1f57157e627c25ae7a843f60157ac52d git reset --hard HEAD~43596f6b1f57 ...
- centos7 时间设置
安装完成centos7后,虽然时区选择的是上海,但是最终的时间还是不对,因为没有开启自动同步NTP功能,所以需要自动手动设置. 首先输入timedatectl命令,查看当前机器的时间: Local t ...
- webpack如何与gulpfile联合的使用
一.对webpack的一些理解 webpack支持CommonJS的书写形式. CommonJS指一个文件一个模块,但会一次性加载(即同步加载),但在浏览器端不适用这种方式,加载速率什么的,于是引入了 ...
- Django数据导入
从网上下载的一些数据,excel表格,xml文件,txt文件等有时候我们想把它导入数据库,应该如何操作呢? 以下操作符合 Django版本为 1.6 ,兼顾 Django 1.7, Django 1. ...
- Lua源代码阅读分析问题列表(转)
最近正在阅读lua源码,遇到座灯塔,转载如下: 我个人的习惯是带着问题去研究一个新题目,比如这次阅读Lua代码,暂列下面这些问题. 1)什么是基于栈.基于寄存器的虚拟机(VM)设计?Lua如何实现基于 ...
- hadoop+tachyon+spark的zybo cluster集群综合配置
1.zybo cluster 架构简述: 1.1 zybo cluster 包含5块zybo 开发板组成一个集群,zybo的boot文件为digilent zybo reference design提 ...
- js将数字转成大写中文
<script type="text/javascript"> //主函数 function DX(n) { if (!/^(0|[1-9]\d*)(\.\d+)?$/ ...
- 不需要sql进行计算数据的平均值、最大值、最小值、和
介绍下SqlServer.前端js.后台C#三个阶段对均值.最大值.最小值.和计算int[] jisuan = {0, 1, 3, 5, 7,8 }; List<int> jisuan2 ...