Table of Contents

Class SceneExtensions

Namespace
Stride.CommunityToolkit.Engine
Assembly
Stride.CommunityToolkit.dll

Provides extension methods for the Scene class to enhance camera-related functionality.

public static class SceneExtensions
Inheritance
SceneExtensions

Methods

GetCamera(Scene)

Retrieves the first CameraComponent found in the scene.

public static CameraComponent? GetCamera(this Scene scene)

Parameters

scene Scene

The Scene in which to search for the camera.

Returns

CameraComponent

The first CameraComponent found in the scene, or null if no camera is present.

Remarks

This method searches through the scene's entities and returns the first camera it finds. It performs a recursive search through child entities as well.

GetCamera(Scene, string)

Retrieves the first CameraComponent in the scene that belongs to an entity with the specified name.

public static CameraComponent? GetCamera(this Scene scene, string name)

Parameters

scene Scene

The Scene in which to search for the camera.

name string

The name of the Entity containing the desired camera.

Returns

CameraComponent

The first CameraComponent found with the specified entity name, or null if no matching camera is found.

Remarks

This method searches through the scene's entities for a camera that belongs to an entity with the given name. It performs a recursive search through child entities as well.