Table of Contents

Class

Namespace
CoreFramework

Provides extension methods for the Camera class to enhance functionality and simplify common operations.

public static class CameraExtensions
Inheritance
object

Methods

GetViewportExtentsWithMargin(Camera, Vector2?)

Calculates the viewport extents of a camera, including an optional margin.

public static Vector2 GetViewportExtentsWithMargin(this Camera camera, Vector2? viewportMargin = null)

Parameters

camera Camera

The camera for which the viewport extents are calculated.

viewportMargin Vector2?

An optional margin to add to the viewport extents. Defaults to a margin of 0.2f for both axes if not provided.

Returns

Vector2

A Vector2 representing the viewport extents with the applied margin.