SceneRenderLayer RenderLayer { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

The RenderLayer property of a SceneObject specifies the rendering layer for the object. This property is used to determine which layer the object should be drawn on. For the object to be rendered, the target layer must match the RenderLayer property, or the target layer must be unset. Additionally, the rendering flags must match for the object to be drawn.

Usage

To use the RenderLayer property, you can get or set its value to control the rendering layer of a SceneObject. This is useful for organizing objects into different layers for rendering purposes, such as separating UI elements from game objects.

Example

// Example of setting the RenderLayer for a SceneObject
SceneObject mySceneObject = new SceneObject();
mySceneObject.RenderLayer = SceneRenderLayer.UI; // Set the object to render on the UI layer

// Example of checking the RenderLayer
if (mySceneObject.RenderLayer == SceneRenderLayer.Default)
{
    // Perform actions if the object is on the default render layer
}