使用Application.RegisterLogCallback来调试程序
来源:互联网 发布:服务器架设软件 编辑:程序博客网 时间:2024/05/16 04:55
该方法可以监听到unity中所有的log消息,然后你可以选择保存到文件中或者显示到gui上做调试来用。
通过LogType来判断处理哪些类型的消息需要被保存或显示。
LogType如下:
ErrorLogType used for Errors.
AssertLogType used for Asserts. (These indicate an error inside Unity itself.)
WarningLogType used for Warnings.
LogLogType used for regular log messages.
ExceptionLogType used for Exceptions.
unity3d提供的例子:
using UnityEngine;using System.Collections;public class example : MonoBehaviour { public string output = ""; public string stack = ""; void OnEnable() { Application.RegisterLogCallback(HandleLog); } void OnDisable() { Application.RegisterLogCallback(null); } void HandleLog(string logString, string stackTrace, LogType type) { output = logString; stack = stackTrace; }}
- 使用Application.RegisterLogCallback来调试程序
- Unity Application.platform Quit RegisterLogCallback 语法复习
- 使用GDB来调试程序
- [转载]使用windbg来调试程序
- [Ajax]使用Firebug来调试Ajax程序
- 使用WIFI ADB来调试Android程序
- iOS --- 使用NSAssert来调试程序
- Angular2-使用Augury来调试Angular2程序
- Win32 Application 使用RichEdit控件时程序运行不起来
- 在非控制台程序中使用控制台来调试程序。
- 使用scite和pdb来调试python程序
- 使用strace 和 truss 来协助调试程序
- 如何使用linux下gdb来调试python程序
- 使用linux的strace来调试程序系统调用
- 使用日志来调试
- 使用property file 来customize java application
- 使用Application来实现数据的共享
- 使用Eclipse调试Android Native Application
- hadoop实战 自己运行WordCount.java
- 你现在的困境,是你以前的困境,还可能是未来的困境
- struts2学习之道
- 电脑的启动过程
- C# 复习 For循环---九九乘法表
- 使用Application.RegisterLogCallback来调试程序
- javascript基础加强
- 单例运行
- KNN学习笔记
- 打不如疼
- 求数组中元素的和
- 用正则表达式验证用户名密码
- SGU 253. Theodore Roosevelt
- 简单工厂模式及工厂模式