System.IDisposable AddHookBeforeOverlay( string debugName, int order, System.Action<SceneCamera> renderEffect )

book_4_sparkGenerated
code_blocksInput

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 this method, provide a debugName for identification, an order to determine the execution sequence, and a renderEffect action that defines the 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();

IDisposable hook = cameraComponent.AddHookBeforeOverlay(
    "MyCustomEffect",
    10,
    (sceneCamera) => {
        // Custom rendering logic here
    }
);

// To remove the hook
hook.Dispose();