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; } }
时间: 2024-11-19 22:09:30