Description
The ScreenRect
property of the CameraComponent
class represents the size of the viewport in screen coordinates. This property is crucial for determining the area of the screen that the camera will render to, allowing developers to manage how the camera's view is displayed on the screen.
Usage
To use the ScreenRect
property, you can access it directly from an instance of CameraComponent
. This property is read-only and provides the current screen rectangle dimensions.
Example
// Example of accessing the ScreenRect property
CameraComponent cameraComponent = new CameraComponent();
Rect screenRect = cameraComponent.ScreenRect;
// Output the screen rectangle dimensions
// Note: Replace with appropriate logging or UI display method
Debug.Log($"Screen Rect: {screenRect}");