Advertisement
johnnygoodguy2000

ScreenUtils

Mar 17th, 2024
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.45 KB | Gaming | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5.  
  6. public static class ScreenUtils
  7. {
  8.     public static float ScreenTop
  9.     {
  10.         get
  11.         {
  12.             return Camera.main.ScreenToWorldPoint(new Vector3(0, Screen.height, 0)).y;
  13.         }
  14.     }
  15.  
  16.     public static float ScreenBottom
  17.     {
  18.         get
  19.         {
  20.             return Camera.main.ScreenToWorldPoint(new Vector3(0, 0, 0)).y;
  21.         }
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement