mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-14 16:51:28 +00:00
Update SafeTop.cs
This commit is contained in:
@@ -19,10 +19,14 @@ namespace TEngine
|
||||
|
||||
private static float _notchHeight;
|
||||
|
||||
public static void CheckNotch(bool applyEditorNotch = false)
|
||||
public static void CheckNotch(bool applyEditorNotch = true)
|
||||
{
|
||||
#if UNITY_EDITOR
|
||||
_notchHeight = applyEditorNotch ? Screen.safeArea.y > 0f ? Screen.safeArea.y : Screen.currentResolution.height - Screen.safeArea.height : 0f;
|
||||
if (_notchHeight < 0)
|
||||
{
|
||||
_notchHeight = 0;
|
||||
}
|
||||
#else
|
||||
_notchHeight = Screen.safeArea.y > 0f ? Screen.safeArea.y : Screen.currentResolution.height - Screen.currentResolution.height;
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user