| Parameter | Description |
|---|---|
| type | A single inset type to query. Passing combined flags throws an ArgumentException. |
Rect The screen-space rectangle where the overlapping inset covers the application window, or Rect.zero if the inset is not overlapping.
Returns the screen-space rectangle where an overlapping inset covers the application window.
Returns the bounds in Unity screen coordinates (origin bottom-left, y-up), matching the coordinate system of Screen.safeArea. Returns Rect.zero if the specified inset is not overlapping or if AndroidWindowInsets.Type.None is passed. Only a single inset type may be passed; passing combined flags throws an ArgumentException.
The returned rect accounts for resolution scaling when Screen.SetResolution is used.
using UnityEngine; using UnityEngine.Android;
public class Controller : MonoBehaviour { public void Update() { var statusBarBounds = AndroidApplication.currentWindowInsets.GetBounds(AndroidWindowInsets.Type.StatusBars); if (statusBarBounds.width > 0) Debug.Log("Status bar covers: " + statusBarBounds); } }