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文件
363476-20160821234231183-1276911599.png

363476-20160821234038198-669809906.png

開啓方法

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),點擊菜單欄 Reporter — Create,將會在場景中創建一個Reporter的Gameobject上綁定了ReporterReporterMessageReceiver腳本
  2. 點擊 Edit — Project Settings —Scrip 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


 
  1. void OnHideReporter()

  2. {

  3. //TO DO : resume your game

  4. //NOTE if use ngui enable input

  5. //if (UICamera.eventHandler != null)

  6. //{

  7. // UICamera.eventHandler.useMouse = true;

  8. // UICamera.eventHandler.useTouch = true;

  9. //}

  10. }

  11.  
  12. void OnShowReporter()

  13. {

  14. //TO DO : pause your game and disable its GUI

  15. //NOTE if use ngui disable input

  16. //if (UICamera.eventHandler != null)

  17. //{

  18. // UICamera.eventHandler.useMouse = false;

  19. // UICamera.eventHandler.useTouch = false;

  20. //}

  21. }

其它注意事項

亮兄此文中提到,如果場景是使用Assetbundle加載的話會出現異常,他的處理方式是把用到 string[] scenes ;的地方進行了屏蔽(註釋)

我並沒有詳細測試使用ab場景的情況,我是通過判空來避免異常的出現,查看我的修改:https://github.com/zhaoqingqing/blog_samplecode/commit/f0eb5045cd9aa1bda7efe257647e885f6367ed14

豎屏顯示問題

在豎屏下,默認頂部的按鈕顯示的不完整,但實際上,頂部欄是可以滑動的。

並且在Setting(設置)中是可以放大和縮小字體的。

轉載於:https://www.cnblogs.com/zhaoqingqing/p/5794009.html

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章