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 renderEffect
action receives a SceneCamera
as a parameter, allowing you to manipulate the camera's rendering behavior.
Since this method is obsolete, consider using alternative methods for adding rendering hooks.
Example
// Example usage of AddHookAfterUI
CameraComponent cameraComponent = new CameraComponent();
IDisposable hook = cameraComponent.AddHookAfterUI(
"MyDebugHook",
10,
(sceneCamera) => {
// Custom rendering logic here
}
);
// Dispose the hook when no longer needed
hook.Dispose();