Description
The IsMainCamera
property of the CameraComponent
class indicates whether the current camera is the main game camera. This property returns a boolean value, where true
signifies that the camera is the main camera used in the game scene, and false
indicates otherwise.
Usage
Use the IsMainCamera
property to determine if a particular camera component is set as the main camera in your game. This can be useful for managing multiple cameras in a scene and ensuring that the correct camera is used for rendering the main view.
Example
// Example of checking if a camera is the main camera
CameraComponent camera = new CameraComponent();
if (camera.IsMainCamera)
{
// Perform actions specific to the main camera
// For example, update UI elements or adjust settings
}