Application翻译:^牛^魔王
- absoluteURL
- backgroundLoadingPriority
- CancelQuit
- CanStreamedLevelBeLoaded
- CaptureScreenshot
- dataPath
- ExternalCall
- ExternalEval
- GetStreamProgressForLevel
- internetReachability
- isEditor
- isLoadingLevel
- isPlaying
- isWebPlayer
- levelCount
- loadedLevelName
- loadedLevel
- LoadLevelAdditiveAsync
- LoadLevelAdditive
- LoadLevelAsync
- LoadLevel
- LogCallback
- OpenURL
- persistentDataPath
- platform
- Quit
- RegisterLogCallbackThreaded
- RegisterLogCallback
- runInBackground
- srcValue
- streamedBytes
- systemLanguage
- targetFrameRate
- temporaryCachePath
- unityVersion
- webSecurityEnabled
Application.RegisterLogCallback 注册日志回调
static function RegisterLogCallback (handler : Application.LogCallback) : void
Description描述
Register a delegate to be called on log messages.
在一个日志信息上注册一个委托来被调用。
Pass null to remove log handler.
通过null来去除日志处理器。
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 : String = "";
var stack : String = "";
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;
}
最后修改:2011年7月20日 Wednesday 13:07