mirror of
https://github.com/unity-atoms/unity-atoms.git
synced 2025-01-23 16:48:23 -05:00
17 lines
454 B
C#
17 lines
454 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; ;
|
||
|
}
|
||
|
}
|
||
|
}
|