Skip to main content

LI PASS Lua Error Event Callback Information (LILuaErrorObserver)

If you are using Unreal Engine, see LILuaErrorObserver of the Unreal Engine SDK.

Register the LI PASS Lua Error event's callback, the game needs to handle the callback function.The callback will be triggered when an error occurs at the Lua layer.

note

It is strongly advised to register in the application startup function.Supported from LI PASS V1.06 onwards.

Function Definition

// Add callback
void AddLILuaErrorObserver(OnLILuaErrorResultHandler<string> liLuaError);
// Remove callback
void RemoveLILuaErrorObserver(OnLILuaErrorResultHandler<string> liLuaError);

Code Sample

// Add callback
public void AddLuaErrorObserver()
{
LevelInfinite.AddLILuaErrorbserver(OnLILuaErrorResult);
}

// Remove callback
public void RemoveLuaErrorObserver()
{
INTLAPI.RemoveLILuaErrorObserver(OnLILuaErrorResult);
}

// Handle the callback result of LILuaErrorObserver
private void OnLILuaErrorResult(string errorStr)
{

}