public override object OnTaskUpdate_Thread(object input, float deltaTime) { unsafe { int bufferLength = CallLuaAPI.lua_gfloginternal_getbufferlength(); byte *logBuffer = (byte *)CallLuaAPI.lua_gfloginternal_getbuffer().ToPointer(); CallLuaAPI.lua_gfloginternal_swapbuffer(); while (bufferLength > 0) { logBuffer = ConvertToIntFromLogBuffer(logBuffer, ref bufferLength, out int type); logBuffer = ConvertToStringFromLogBuffer(logBuffer, ref bufferLength, out string tag); logBuffer = ConvertToStringFromLogBuffer(logBuffer, ref bufferLength, out string message); switch (type) { case LOGTYPE_VERBOSE: MDebug.LogVerbose(tag, message); break; case (int)LogType.Log: MDebug.Log(tag, message); break; case (int)LogType.Warning: MDebug.LogWarning(tag, message); break; case (int)LogType.Error: MDebug.LogError(tag, message); break; default: throw new Exception("Not handle LogType: " + type); } } } return(null); }
public override void OnInitialize() { m_LuaSizetLength = CallLuaAPI.lua_gfloginternal_getsizetlength(); }