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

robot_2Generated
code_blocksInput

Description

The AddHookAfterTransparent method allows you to add a custom rendering hook to the camera's rendering pipeline, specifically after the transparent objects have been rendered. This can be useful for applying post-processing effects or custom rendering logic that should occur after transparent objects are drawn.

Usage

To use the AddHookAfterTransparent method, you need to provide a debug name for the hook, an order value to determine the execution order relative to other hooks, 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 AddHookAfterTransparent
CameraComponent cameraComponent = new CameraComponent();

// Define a rendering effect
Action<SceneCamera> renderEffect = (sceneCamera) =>
{
    // Custom rendering logic here
};

// Add the hook
IDisposable hook = cameraComponent.AddHookAfterTransparent("MyCustomEffect", 0, renderEffect);

// Later, when you want to remove the hook
hook.Dispose();