方法1:
string trackStr = new System.Diagnostics.StackTrace().ToString();
Debug.Log ("Stack Trace:" + trackStr);
方法2:
#if UNITY_5
Application.logMessageReceived += CaptureLog;
#else
Application.RegisterLogCallback(CaptureLog);
#endif