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 即可,例 ...
随机推荐
- Proxy setting
1. git git config --global http.proxy http://proxyuser:proxypwd@proxy.server.com:8080 2. gradleScena ...
- SOAPUI使用教程-测试JDBC数据库
soapUI中有除了开源版本的一些非常实用的功能: 使用在项目级配置的JDBC连接 使用向导创建复杂的查询. 结果显示XML输出视图(以及该使用向导在此视图中提供的XPath断言). 提供JDBC连接 ...
- Ubuntu配置Tomcat9非root用户启动
unix类系统的root用户具有极大的权利,所以很多时候我们不希望程序以root身份启动,这也就是配置Tomcat以指定身份(非root)启动的初衷,虽然也没人来攻击我的服务器,但本着学习学习的目的, ...
- volatile不能保证原子性
1.看图自己体会 2.体会不了就给你个小程序 package cs.util; public class VolatileDemo { private volatile int count =0; p ...
- tomcat发布脚本
#!/bin/bash #发布相关目录Tomcat_log='/home/CodePub/tomcatlog'dev_package='/home/CodePub/package'old_packag ...
- 图论 - 寻找fly真迹
一天fly正坐在课堂上发呆,突然,他注意到了桌面上的一个字符串S1S2S3S4...Sn,这个字符串只由字符"a","b"和"c"构成.刚好 ...
- 2016 windows安装phing:安装成功
21:39 2016/7/212016 windows安装phing:安装成功注意:出现错误时就去更新pear:参见:http://www.cnblogs.com/pinnasky/archive/2 ...
- 格式化input输入内容(金额)
项目中要用到格式化金额输入框,要求每三个数字用逗号分割开. 添加一个directive angular.module('myApp.directives', []) .directive('filte ...
- 关于nginx.pid丢失的解决办法
在停掉nginx的过程中突然出现如下的提示:
- Codeforces Round #361 (Div. 2) A
A - Mike and Cellphone Description While swimming at the beach, Mike has accidentally dropped his ce ...