便捷的方式在手机上查看Unity3D的Console Log(调试信息 日志)

便捷的方式在手机上查看Unity3D的Console Log(调试信息 日志)

https://www.cnblogs.com/zhaoqingqing/p/5794009.html

 

便捷的方式在手机上查看Unity3D的Console Log(调试信息 日志)

Logs Viewer#

功能描述#

Using this tool you can easily check your editor console logs inside the game itself! No need to go back to the project and do any tests to track the problems!

使用此工具,不管在手机或者Unity Editor中,你都可以很容易地检查/查看游戏输出的日志,而不需要回到项目和做任何测试跟踪问题!(开源免费)

功能预览#

在手机上也可以很方便地查看日志,无须打开log文件

开启方法#

All what you have to do is to make a circle gesture using your mouse (click and drag) or your finger (touch and drag) on the mobile screen to show all these logs!

那要怎样显示此日志呢?在PC/MAC等桌面平台,你需要使用鼠标按住并画圈圈,在Mobile平台上,你需要使用手指画圈圈就可以显示日志了

设置步骤#

To setup log viewer do the following

  1. create reporter from menu (Reporter->Create) at first scene your game start .
  2. then set the ” Scrip execution order ” in (Edit -> Project Settings ) of Reporter.cs to be the highest.

设置步骤

  1. 在游戏的主场景(首次启动的Scene),点击菜单栏 ReporterCreate,将会在场景中创建一个Reporter的Gameobject上绑定了ReporterReporterMessageReceiver脚本
  2. 点击 EditProject SettingsScrip Execution Order,在打开的MonoManager中,点击+号,添加Reporter

开源免费#

AssetStore: https://www.assetstore.unity3d.com/en/#!/content/12047

GitHub: https://github.com/aliessmael/Unity-Logs-Viewer/

插件自带的文档:导入资源后在 Reporter/Documentation/index.html

或参考:https://github.com/zhaoqingqing/blog_samplecode/tree/master/unity_protobuf_sample/Assets/Reporter

改进或建议#

本文基于插件的1.6版本 (2016-06-13发布),Unity 5.3.4f1 运行正常。

修改开启圈数#

Reporter 属性面板,修改 Num of Circle to Sh 的数值为其它,默认为1

开启时禁用NGUI的输入#

如果想在开启日志窗口时,禁用NGUI的Input,可以使用添加以下。在ReporterMessageReceiver.cs

 

Copy

void OnHideReporter() { //TO DO : resume your game //NOTE if use ngui enable input //if (UICamera.eventHandler != null) //{ // UICamera.eventHandler.useMouse = true; // UICamera.eventHandler.useTouch = true; //} } void OnShowReporter() { //TO DO : pause your game and disable its GUI //NOTE if use ngui disable input //if (UICamera.eventHandler != null) //{ // UICamera.eventHandler.useMouse = false; // UICamera.eventHandler.useTouch = false; //} }

其它注意事项#

亮兄此文中提到,如果场景是使用Assetbundle加载的话会出现异常,他的处理方式是把用到 string[] scenes ;的地方进行了屏蔽(注释)

我并没有详细测试使用ab场景的情况,我是通过判空来避免异常的出现,查看我的修改:https://github.com/zhaoqingqing/blog_samplecode/commit/f0eb5045cd9aa1bda7efe257647e885f6367ed14

竖屏显示问题#

在竖屏下,默认顶部的按钮显示的不完整,但实际上,顶部栏是可以滑动的。

并且在Setting(设置)中是可以放大和缩小字体的。

作者: 赵青青

出处:https://www.cnblogs.com/zhaoqingqing/p/5794009.html

版权:本文采用「署名-非商业性使用-相同方式共享 4.0 国际」知识共享许可协议进行许可。

我是一个乐于分享和学习未知知识,并勤于写作的技术人,擅长游戏开发,客户端技术,微软系技术等领域。
Believe Code Change The World , Just Do IT. Keep It Simple, Self-Discipline Will Make Me Free.

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值