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

robot_2Generated
code_blocksInput

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 it is no longer needed.

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 perform operations on the camera during the rendering process.

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();

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

// When the hook is no longer needed
hook.Dispose();