Description
The AddHookBeforeOverlay
method allows you to add a custom rendering effect to be executed before the overlay stage of the camera's rendering process. This can be useful for applying effects or modifications to the scene just before the overlay is drawn.
Usage
To use the AddHookBeforeOverlay
method, you need to provide a debug name for the hook, an order value to determine the execution sequence, and a delegate that defines the rendering effect to be applied. The method returns an IDisposable
object, which can be used to remove the hook when it is no longer needed.
Example
// Example of using AddHookBeforeOverlay
CameraComponent cameraComponent = new CameraComponent();
// Define a rendering effect
Action<SceneCamera> renderEffect = (sceneCamera) =>
{
// Custom rendering logic here
};
// Add the hook
IDisposable hook = cameraComponent.AddHookBeforeOverlay("MyCustomEffect", 0, renderEffect);
// Later, when you want to remove the hook
hook.Dispose();