System.Action OnRenderUI { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

The OnRenderUI property of the SceneCamera class is an event that is triggered during the UI rendering phase of the camera's rendering process. This event allows you to execute custom actions or logic when the camera is rendering its UI elements.

Usage

To use the OnRenderUI property, you can assign a delegate or lambda expression to it. This delegate will be called whenever the camera reaches the UI rendering phase. This is useful for adding custom UI elements or performing operations that need to occur during the UI rendering.

Example

// Example of using the OnRenderUI property
SceneCamera camera = new SceneCamera();

// Assign a lambda expression to the OnRenderUI event
camera.OnRenderUI = () => {
    // Custom UI rendering logic here
    // For example, draw a custom UI element
    // UI.DrawText("Hello, World!", new Vector2(100, 100));
};