unity3d 日志捕捉

public class Test : 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;
    }
}

 

posted @ 2014-10-28 18:20  ing...  阅读(555)  评论(0编辑  收藏  举报