mirror of
https://github.com/unity-atoms/unity-atoms.git
synced 2025-01-24 17:17:47 -05:00
7763f81ede
* Unified all line endings in project to align with .editorconfig; all end-of-line characters have been set to LF and new-lines placed at the end of every file if not present.
18 lines
455 B
C#
18 lines
455 B
C#
using UnityEngine;
|
|
|
|
namespace UnityAtoms.Extensions
|
|
{
|
|
public static class CameraExtensions
|
|
{
|
|
public static float GetOrthographicWorldScreenHeight(this Camera camera)
|
|
{
|
|
return camera.orthographicSize * 2f;
|
|
}
|
|
|
|
public static float GetOrthographicWorldScreenWidth(this Camera camera)
|
|
{
|
|
return camera.GetOrthographicWorldScreenHeight() / Screen.height * Screen.width; ;
|
|
}
|
|
}
|
|
}
|