Provides an array of AndroidFoldingFeature data for the current display.
Returns an empty array if the current display doesn't support folding features. Use this information immediately after requesting as the system updates it automatically.
The following code example demonstrates how to update the UI for full-screen or split-screen modes based on the current folding features data.
using UnityEngine; using UnityEngine.Android;
public class MyApplication : MonoBehaviour { public void Start() { OnFoldingFeaturesUpdated(AndroidApplication.currentFoldingFeatures); AndroidApplication.onFoldingFeaturesUpdated += OnFoldingFeaturesUpdated; }
public void OnDisable() { AndroidApplication.onFoldingFeaturesUpdated -= OnFoldingFeaturesUpdated; }
private void OnFoldingFeaturesUpdated(AndroidFoldingFeature[] ffs) { if (ffs.Length == 0 || !ffs[0].isSeparating) { // update UI for full screen } else // ffs[0].isSeparating { // update UI for split screen using ffs[0].bounds and ffs[0].occlusionType } } }