Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


currentFoldingFeatures

Provides an array of AndroidFoldingFeature data for the current display.
Read time 1 minuteLast updated 6 days ago

Definition

public static AndroidFoldingFeature[] currentFoldingFeatures { get; }

Remarks

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.

Examples

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[] foldInfo) { if (foldInfo.Length == 0 || !foldInfo[0].isSeparating) { // update UI for full screen } else // foldInfo[0].isSeparating { // update UI for split screen using foldInfo[0].bounds and foldInfo[0].occlusionType } }}