Skip to content
This repository has been archived by the owner on Jul 6, 2023. It is now read-only.

Latest commit

 

History

History
35 lines (32 loc) · 622 Bytes

MotionLog.md

File metadata and controls

35 lines (32 loc) · 622 Bytes

日志 (MotionLog)

监听框架生成的日志

using MotionFramework;

public void Start()
{
	MotionEngine.Initialize(this, HandleMotionFrameworkLog);
}

private void HandleMotionFrameworkLog(ELogLevel logLevel, string log)
{
	if (logLevel == ELogLevel.Log)
	{
		UnityEngine.Debug.Log(log);
	}
	else if (logLevel == ELogLevel.Error)
	{
		UnityEngine.Debug.LogError(log);
	}
	else if (logLevel == ELogLevel.Warning)
	{
		UnityEngine.Debug.LogWarning(log);
	}
	else if (logLevel == ELogLevel.Exception)
	{
		UnityEngine.Debug.LogError(log);
	}
	else
	{
		throw new NotImplementedException($"{logLevel}");
	}
}