using System.Collections; using System.Collections.Generic; using UnityEngine; namespace BF { public class SafeAreaManager { private static SafeAreaManager instance; public static SafeAreaManager Instance{ get { if (instance == null) { instance = new SafeAreaManager(); } return instance; } } /// /// 得到安全区域 /// /// public static Rect GetSafeArea () { return Screen.safeArea; } /// /// 得到竖屏时的刘海高度 /// /// public static float GetNotchScreenHeight() { Rect rect = GetSafeArea(); return Screen.height - rect.height - rect.y; } } }