Description
The AddHookAfterUI
method allows you to add a rendering hook that executes after the UI rendering stage. This method is marked as obsolete, indicating that it may be removed in future versions and should be avoided in new code. The method returns an IDisposable
object, which can be used to remove the hook when disposed.
Usage
To use AddHookAfterUI
, provide a debugName
for identification, an order
to determine the execution sequence, and a renderEffect
action that defines the rendering logic to be executed. The order
parameter allows you to control the sequence in which multiple hooks are executed, with lower numbers executing first.
Since this method is obsolete, consider using alternative methods for adding rendering hooks, such as AddHookAfterTransparent
or AddHookBeforeOverlay
, which are not marked as obsolete.
Example
// Example usage of AddHookAfterUI
CameraComponent cameraComponent = new CameraComponent();
// Define a render effect action
Action<SceneCamera> renderEffect = (sceneCamera) => {
// Custom rendering logic here
};
// Add a hook after UI rendering
using (IDisposable hook = cameraComponent.AddHookAfterUI("MyDebugHook", 10, renderEffect))
{
// The hook is active within this using block
// Perform operations that require the hook
}
// The hook is automatically removed when disposed