找回密碼
 注冊帳號

掃一掃,訪問微社區

application.logcallback 日志回調

2014-12-31 08:42| 發布者: 楊炎| 查看: 3097| 評論: 0|原作者: 蠻牛|來自: unity3d腳本manual

摘要: application.logcallback 日志回調delegatelogcallback(condition: string,stacktrace: string,type:logtype) : voiddescription描述use this delegate type with registerlogcallback to monitor what gets logged. ...

application.logcallback 日志回調

delegatelogcallback(condition: string,stacktrace: string,type:logtype) : void

description描述

use this delegate type with registerlogcallback to monitor what gets logged.

用registerlogcallback來使用這個委托類型,去監控什么得到記錄了

c#

javascript

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;

}

}

var output = "";

var stack= "";

function onenable () {

application.registerlogcallback(handlelog);

}

function ondisable () {

// remove callback when object goes out of scope

//當對象超出范圍,刪除回調

application.registerlogcallback(null);

}

function handlelog (logstring : string, stacktrace : string, type : logtype) {

output = logstring;

stack = stacktrace;

}

參見:application.registerlogcallback,logtype

相關閱讀

文章點評
相關文章
女校游泳队彩金